Normalize TYP_BYREF to TYP_INT in implicit casts even on x86 - #131442
Normalize TYP_BYREF to TYP_INT in implicit casts even on x86#131442adamperlin wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR adjusts impImplicitIorI4Cast in the JIT importer so the “pointer-like (ref/byref) -> int” normalization path is no longer accidentally gated to TARGET_64BIT, enabling the same implicit-cast normalization behavior on x86 as well.
Changes:
- Move the
#endif // TARGET_64BITso the(wantedType == TYP_INT) && varTypeIsI(currType)cast-to-TYP_INTpath is compiled on all targets. - Preserve the existing 64-bit-only behavior for casting
TYP_INTtoTYP_I_IMPLwhenTYP_I_IMPL != TYP_INT.
|
The negative diffs mostly look like a cast that’s preserved in lowering and which messes up LSRA because it has no concept of the operation effectively being a no-op and being able to consume the original value “as-is” This is very similar to the issue we had for SIMD where several scalar or getlower and other APIs were also “no-ops” and only there to satisfy the type system, so I had to rework lowering to always strip them (where legal) and then codegen to expect those shapes given it’s around 1 million bytes on x86, I imagine we have similar register to register waste for x64 (and lesser but still large waste on Arm64) and it’d be highly profitable to handle |
No description provided.