Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When min major R2R version moves forward, consider some cleanups #98871

Open
VSadov opened this issue Feb 23, 2024 · 6 comments
Open

When min major R2R version moves forward, consider some cleanups #98871

VSadov opened this issue Feb 23, 2024 · 6 comments

Comments

@VSadov
Copy link
Member

VSadov commented Feb 23, 2024

GCInfo version v3 is backward-compatible with v2. That is intentional to not require moving forward the R2R min major version.

However, if the min major version is incremented for other reasons, consider the following (not backward-compatible) changes -

  • Safe points are historically encoded with offset -1. It is no longer necessary and not doing that could simplify some code.
  • GCInfo v3 is sufficient that hijacking could be done without knowing whether a method is object/ref returning.
    Once v2 is no longer in use, both GCInfo and hijacking logic could be simplified.
  • Actually anything that is keyed off !AreSafePointsInterruptible could be removed, except when needed to support x86.
    (i.e. anything for RISC architectures can stop supporting noninterruptible call sites)
  • Also consider removing DOTNET_InterruptibleCallSites knob at that time

These suggestions are not by themselves enough to bump the min major version, but the version moves forward for other reasons, please consider doing these as well.

@VSadov VSadov added this to the Future milestone Feb 23, 2024
@EgorBo
Copy link
Member

EgorBo commented Feb 24, 2024

Some helpers can be removed too, #98858 (comment)
I presume we most likely will need to bump the minimal R2R version for SVE work

@VSadov
Copy link
Member Author

VSadov commented Feb 24, 2024

Right. Let's keep this as a holder for cleanups, conditional on revving min version.
When that happens we can split this into multiple actionable workitems for the milestone when that happens.

@jkotas jkotas changed the title When min major R2R version moves forward, consider some cleanups in GCInfo When min major R2R version moves forward, consider some cleanups Feb 24, 2024
@filipnavara
Copy link
Member

Likewise there are some ARM helpers that are now obsolete. We marked them with a comment in the appropriate source code.

@MichalPetryka
Copy link
Contributor

MichalPetryka commented Mar 4, 2024

The delegate method pointers (which are being swapped in #99200 to avoid R2R bump) can be swapped back on the next bump for some minor perf improvements.
EDIT: Especially on ARM64 since we'll then emit ldp instead of 2 ldrs:
image

@davidwrighton
Copy link
Member

I now have a PR #100310 which represents the cleanups.

I've talked with @VSadov, and unfortunately, it looks like the V3 GCInfo isn't happening due to an issue with our codegen in RyuJit that won't get fixed this release.

@MichalPetryka I know you've done some work on the math helpers, I can see that we only want to remove the floating point rounding helpers instead of the 4 helpers you initially proposed as making ready for removal.

Since #99200 is not yet in, I haven't put together the changes to re-order the fields.

@VSadov
Copy link
Member Author

VSadov commented Mar 26, 2024

I've talked with @VSadov, and unfortunately, it looks like the V3 GCInfo isn't happening due to an issue with our codegen in RyuJit that won't get fixed this release.

The issue might be fixable. I am still looking at how it may be dealt with.

There are some obvious solutions like placing a NOP at the end of every basic block that ends on a method call, but I'd prefer a solution that is less intrusive (which I did not figure yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@EgorBo @filipnavara @VSadov @davidwrighton @teo-tsirpanis @MichalPetryka and others