-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Mark vars as do not enreg earlier in minopts. #54998
Mark vars as do not enreg earlier in minopts. #54998
Conversation
/azp run runtime-coreclr jitstress, runtime-coreclr outerloop |
Azure Pipelines successfully started running 2 pipeline(s). |
|
||
// Mark the dest/src structs as DoNotEnreg when they are not being fully referenced as the same type. | ||
// | ||
if (!m_dstDoFldAsg && (m_dstVarDsc != nullptr) && !m_dstSingleLclVarAsg) |
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.
after this change init/copy like:
[000015] -ACXG------- * ASG struct (copy)
[000013] D----+-N---- +--* LCL_VAR struct<S, 8> V01 loc0
[000012] --CXG+------ \--* CALL struct TestStructFields.Program.GetS1
don't require doNotEnreg flag. The condition was moved after we do m_comp->fgMorphBlockOperand
to work after OBJ(ADDR(LCL))
folding.
@@ -3467,7 +3473,7 @@ void Compiler::lvaSortByRefCount() | |||
assert(varDsc->lvType != TYP_STRUCT || | |||
varDsc->lvDoNotEnregister); // For structs, should have set this when we set lvAddrExposed. | |||
} | |||
else if (varTypeIsStruct(varDsc)) | |||
if (varTypeIsStruct(varDsc)) |
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.
the idea of if/else
was that each block was setting lvaSetVarDoNotEnregister
and there was no need to check the rest, now we have blocks that don't set it, so we need to check each.
PTAL @BruceForstall @dotnet/jit-contrib , another preparation for structs in registers, small changes and diffs. |
@sandreenko - We noticed several regressions possibly related to this change. Do you mind going through some of them to confirm if they are indeed from this change? |
Simplest repro:
It prints around |
Sure, looking at them now, thanks for reporting it. |
Hm, don't see this:
I will check other regressions. |
@sandreenko I've just checked on a clean repo again - still reproduces for me |
@sandreenko managed to get the diff between two coreruns: https://www.diffchecker.com/qh9EOTD4 |
Thank you, now I see them, I had a system-wide tiering disabled that I forgot about. |
and improve morph block init/copy a little bit.
There is a known problem that we start asking
is it already known to be not on register?
before the value is finalized during morph (block copy, should we do field by field) and lowering (do we need bitcast? can we mark the source as contained?) .I have an markdown description of it in 6.0 planning.
For now, just mark them as
doNotEnreg
earlier when enregistration is disabled. Give us small improvements on minopts methods and prevent some regressions with future changes.+no diffs improvements of morph block init/copy.