-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: Improve inliner - static readonly fields, pinvokes, Span::Length #62421
Conversation
1) recognize pinvokes 2) remove "CALL(cns,...) -> CNS" heuristic 3) mark Span/ReadOnlySpan get_Length as intrinsic 4) recognize "static readonly" fields of primitive types as constants
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsContributes to #59002 This PR:
Jit-diff after these changes: TODO:
|
😉 |
/cc @BrzVlad |
…iner-part-3 # Conflicts: # src/coreclr/jit/fgbasic.cpp
Also, handle GetType intrinsic
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
Contributes to #59002
This PR:
static readonly
fields of primitive types as potential constants => finds more potential foldable expressions/branches.ReadOnlySpan/Span::get_Length
as[Intrinsic]
- this simple change alone generates-6037
negative diff! 😮call(CNS, ...) -> CNS
heuristic. Currently, if jit sees a call and suspects its first argument is a const - it assumes it is likely to become a constant too - this produced many false-positive "foldable branches" and a large diff as the result.IsLatin1
intoIsDigit
here)Jit-diff after these changes:
Total bytes of delta: -292814 (-0.71 % of base)
(jitutils, -f, crossgen2) - will post more detailed diffs soon.TODO:
getMethodAttribs
andgetStaticFieldCurrentClass
)