JIT: Ensure fgTryMorphStructArg morphs created trees#113496
JIT: Ensure fgTryMorphStructArg morphs created trees#113496jakobbotsch merged 2 commits intodotnet:mainfrom
fgTryMorphStructArg morphs created trees#113496Conversation
In particular we could create `LCL_FLD` or `LCL_VAR` nodes for address exposed locals without marking them with `GTF_GLOB_REF`. This would result in not creating some necessary copies.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a regression test targeting the JIT behavior to ensure that fgTryMorphStructArg properly morphs created trees, preventing missing copies for address-exposed locals.
- Added a new test file to validate the behavior of fgTryMorphStructArg in both Debug and Release builds.
- The test exercise involves struct field manipulation and vector creation to trigger the intended morphing in the JIT.
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS Diffs. Quite substantial diffs from this change. Overwhelmingly these diffs come from tests, however. |
AndyAyersMS
left a comment
There was a problem hiding this comment.
Is this a regression? Wondering if we need to keep a close eye on SetMorphed or something.
Yes, this is a regression from #112612, although from a preexisting bug in fgMorphTree BB01, STMT00006 (before)
[000018] --CXG------ ▌ CALL void Program:M4(S0,System.Runtime.Intrinsics.Vector256`1[ushort])
[000011] ----------- arg0 ├──▌ LCL_VAR struct<S0, 4>(AX)(P) V00 loc0
├──▌ int field V00.F0 (fldOffset=0x0) -> V04 tmp3
[000017] --CXG------ arg1 └──▌ HWINTRINSIC simd32 ushort Create
[000013] --CXG------ └──▌ CALL int S0:M7():ushort:this
[000012] ----------- this └──▌ LCL_ADDR byref V00 loc0 [+0]
▌ int field V00.F0 (fldOffset=0x0) -> V04 tmp3 When morphing args we first morph After #112612 we instead call into |
|
Possible regressions in BigInteger: dotnet/perf-autofiling-issues#52301 |
In particular we could create
LCL_FLDorLCL_VARnodes for address exposed locals without marking them withGTF_GLOB_REF. This would result in not creating some necessary copies.Fix #113488
Diffs expected -- regressions from more copies introduced. Some improvements from the morphing when it does good things, and from not creating field lists for some DNER cases.