-
Notifications
You must be signed in to change notification settings - Fork 5.1k
JIT: Consistently use TypeIs
/OperIs
for type/oper checks
#116141
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
I would be more interested in replacing |
I can try adding that to this PR. There's also |
TypeIs
/OperIs
for type/oper checks
PTAL @dotnet/jit-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes type and operator checks across the JIT by introducing and using TypeIs
and OperIs
in place of direct TypeGet
/gtType
and OperGet
/gtOper
comparisons.
- Adds
LclVarDsc::TypeIs
(and variadic overload) for succinct multi‐type checks - Replaces
OperGet() == ...
withOperIs(...)
everywhere - Replaces
gtType
/TypeGet()
checks withTypeIs(...)
Reviewed Changes
Copilot reviewed 74 out of 74 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
emitriscv64.cpp | OperGet /gtType → OperIs /TypeIs in emitter logic |
emitarm64.cpp, emitarm.cpp | Same replacements in ARM emitters |
emit.cpp, earlyprop.cpp | Replaced legacy checks in codegen and early propagation |
decomposelongs.cpp | Assertions on GT_LONG use OperIs |
compiler.hpp, compiler.h, compiler.cpp | Added TypeIs and replaced type/operator checks |
codegen*.cpp (xarch, risc-V, LoongArch, ARM) | Wide spread substitutions in code generators |
block.cpp, async.cpp, assertionprop.cpp | Updated IR checks in flow/block and assertion props |
codegencommon.cpp | Address mode and register mask logic updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised to see up to +0.12 TP regression - is it because of inlining?
Hmm, good question. In fact it does not repro for me locally... I get these results: Overall (-0.04% to +0.00%)
MinOpts (-0.15% to -0.07%)
FullOpts (-0.03% to +0.02%)
DetailsAll contexts:
MinOpts contexts:
FullOpts contexts:
I would expect that yes, it has to do with different inlining decisions, and it's probably quite sensitive to MSVC version. If that's the case it will change entirely with native PGO enabled. It also looks like there are no TP diffs with clang, so I will merge as-is. |
LclVarDsc::TypeIs
TypeIs
andOperIs
everywhere (replacements done with a series of regex)