-
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
Fix 'varDsc->lvExactSize == 12' assert. #38484
Conversation
5b593cb
to
338a4d1
Compare
16f31a2
to
6294a31
Compare
PTAL @briansull @CarolEidt @tannergooding @dotnet/jit-contrib |
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.
LGTM - thanks!
{ | ||
m_pCompiler->lvaGetDesc(cseLclVarNum)->lvSIMDType = true; |
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.
Do we still set lvSIMDType to true for the new CSE SIMD LclVars?
Is it done by lvaSetStruct?
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.
Yes,lvaSetStruct
handles it:
runtime/src/coreclr/src/jit/lclvars.cpp
Lines 2633 to 2637 in d69cfa0
if (simdBaseType != TYP_UNKNOWN) | |
{ | |
assert(varTypeIsSIMD(varDsc)); | |
varDsc->lvSIMDType = true; | |
varDsc->lvBaseType = simdBaseType; |
src/coreclr/src/jit/optcse.cpp
Outdated
@@ -3216,7 +3214,7 @@ bool Compiler::optIsCSEcandidate(GenTree* tree) | |||
|
|||
// If this is a struct type, we can only consider it for CSE-ing if we can get at | |||
// its handle, so that we can create a temp. |
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.
// If this is a struct type (or SIMD type),
👍 |
It is a small pessimization, but no diffs(benchmarks/libraries),
I had a more ambitious change (based on Tanner's suggestion and ClassLayout added to JitIntrinsic by Carol recently) that required layout for each Intrinsic (SIMD and HW) node to be initialized and it was passing tests. However:
LCL_FLD
for structs with overlapping fields when we dropFldSeq
and can't restoreCLASS_HANDLE
after, so it was not clear for me how to keep struct handle in this case.Fixes #36586.