-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix to SquareRootUInt16 test failure under JitStress=1/2 #3087
Conversation
JitStress=1/2 is inducing GS check as a result of which the Vector argument gets shadow copied. But on the shadow copy lcl var SIMD specific state is not set and as a result of which rationalization doesn't happen properly leading to silent bad codegen.
@dotnet/jit-contrib - please review this. |
LGTM |
@dotnet-bot test this please |
|
||
var_types type = varTypeIsSmall(varDsc->TypeGet()) ? TYP_INT : varDsc->TypeGet(); | ||
lvaTable[shadowVar].lvType = type; | ||
lvaTable[shadowVar].lvType = type; |
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.
Would it make sense to have a copy method for LclVarDsc?
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.
Not sure that i understood the suggestion. Are you implying to abstract the logic that copies varDsc fields to shadow param into a separate routine? I don't think that would be valuable, because other than gscheck logic no other place has such a need.
VarDsc has many fields but gsParamsToShadow() is selectively copying few of the fields when it creates a shadow lcl var. Are you implying to copy all fields? That would need carefully examining whether it makes sense to verbatim copy and is beyond the scope of this fix.
What is the "other half" of #2886? |
That issue has two test SIMD test failures listed in one bug. This PR is fixing the first test failure. The second test failure seems to be a different issue and still repros and under investigation. Thought it a good idea to get one fix in and hence this PR. |
@sivarv - thanks for the explanation. LGTM |
hello world (test CI) |
Fix to SquareRootUInt16 test failure under JitStress=1/2
JitStress=1/2 is inducing GS check as a result of which the Vector argument gets shadow copied and all occurrences of original arg gets replaced by its shadow copy lcl var. But on the shadow copy lcl var SIMD specific state is not set and as a result of which rationalization doesn't happen properly leading to silent bad codegen.
This fixes half of issue #2886.