Support for variable sized locals in morph and lclmorph#124516
Support for variable sized locals in morph and lclmorph#124516snickolls-arm wants to merge 7 commits intodotnet:mainfrom
Conversation
Adds handling for unknown compile-time sizes to morph related to indirections and addressing of variables and struct fields. LCL_ADDR is allowed for TYP_SIMD/TYP_MASK if the address offset is zero, as this is the only offset that is provably within bounds for something with an unknown size at compile time. We can only reduce ADD(LCL_ADDR(BASE), OFFSET) for such locals when BASE and OFFSET are zero. We only process STOREIND or IND as STORE_LCL_FLD/LCL_FLD if the indirection points to the entire variable (the indirection offset is zero and the ValueSizes are equivalent).
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
@dotnet/arm64-contrib @dotnet/jit-contrib |
|
There are some regressions in the diffs causing by spilling registers to stack, which I think might indicate some accesses are incorrectly labelled as address exposed. Looking into this as this shouldn't show any diffs to baseline compilation, it should only affect |
* Add IsWideAccess for determining whether an access should make a local address-exposed. * Refactor existing bounds checking logic to use IsWideAccess. * Add handling or types that don't have sizes at compile-time. Such types can check whether an access is entire using IsEntireAccess and set them address-exposed if this is not the case. * Separate some handling for zero-sized indirections into explicit comparisons.
|
My latest commits have reversed the diffs, it was to do with implicit handling of zero-sized indirections that I missed the first time around. While I'm in the area I've cleaned up a TODO, and made some of the various bounds checking over morph use similar logic. @dotnet/arm64-contrib please could I have a review? |
|
I reran the x86 check for you, there was Also gentle ping @EgorBo for review on this PR, I think you have context in this area/workstream? Apologies if mistaken |
Adds handling for unknown compile-time sizes to morph related to indirections and addressing of variables and struct fields.
LCL_ADDR is allowed for TYP_SIMD/TYP_MASK if the address offset is zero, as this is the only offset that is provably within bounds for something with an unknown size at compile time.
We can only reduce ADD(LCL_ADDR(BASE), OFFSET) for such locals when BASE and OFFSET are zero.
We only process STOREIND or IND as STORE_LCL_FLD/LCL_FLD if the indirection points to the entire variable (the indirection offset is zero and the ValueSizes are equivalent).