-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: Fix liveness for dependently promoted TYP_LONGs on x86 #73562
Conversation
We were only handling uses of promoted locals when varTypeIsStruct(lcl) was true. For TYP_LONG promoted locals on x86 it is not. Fix dotnet#73559
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsWe were only handling uses of promoted locals when varTypeIsStruct(lcl) Fix #73559
|
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. I was fixing the same issues the other day for multi-reg longs and wondered whether the current state is correct. Turns out not.
There is also this code in ref counting which I think should use the same treatment:
runtime/src/coreclr/jit/compiler.hpp
Lines 1953 to 1964 in d63c65d
if (varTypeIsStruct(lvType) && propagate) | |
{ | |
// For promoted struct locals, increment lvRefCnt on its field locals as well. | |
if (promotionType == Compiler::PROMOTION_TYPE_INDEPENDENT || | |
promotionType == Compiler::PROMOTION_TYPE_DEPENDENT) | |
{ | |
for (unsigned i = lvFieldLclStart; i < lvFieldLclStart + lvFieldCnt; ++i) | |
{ | |
comp->lvaTable[i].incRefCnts(weight, comp, state, false); // Don't propagate | |
} | |
} | |
} |
Many of these conditions look a bit pointless, they could just be checking promotion type and/or lvPromoted
directly, but that's not a 7.0 issue, naturally.
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. I am wondering if these 2 places also need fixup?
runtime/src/coreclr/jit/codegencommon.cpp
Line 3387 in 9865cc7
if (varTypeIsStruct(varDsc) && |
runtime/src/coreclr/jit/compiler.hpp
Line 1906 in 9865cc7
if (varTypeIsStruct(lvType)) |
I don't think it would hurt, but it is not necessary today. We never promote TYP_LONG parameters independently (first one) and there is a |
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
Actually, CI looked particularly fussy so I updated them too to also rerun it. |
We were only handling uses of promoted locals when varTypeIsStruct(lcl)
was true. For TYP_LONG promoted locals on x86 it is not.
Fix #73559