-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: Ensure fgTryMorphStructArg
morphs created trees
#113496
Conversation
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.
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 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. |
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.
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 |
In particular we could create
LCL_FLD
orLCL_VAR
nodes 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.