You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JitStressCLR JIT issues involving JIT internal stress modesarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
if (oper == GT_ADDR && (op1->gtOper == GT_LCL_VAR))
{
tree->gtFlags &= ~GTF_GLOB_REF;
}
It means we end up evaluating the retbuf into a temp and stop being able to recognize it.
This seems to end up happening because in this case we have an isTmp local for the retbuf we are optimizing, and this local is address exposed besides as the ret buf:
#68741 at least fixes introducing the unnecessary temp which resolves the assert. However, I think we should leave this open just to investigate whether it is in general safe to do the ret buf optimization here. I suppose yes, since the local does end up marked as address exposed and will not actually be tracked.
I have attached a SPMI context for the compile where it happens which I collected on git hash 5c2a738 (with the fix from #68741 applied). The above tree comes from around line 4334 in the JIT dump.
JitStressCLR JIT issues involving JIT internal stress modesarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Activity
jakobbotsch commentedon Apr 28, 2022
One part of the problem is that we end up with a
GTF_GLOB_REFon aGT_ADDRnode because the following does not handle locals generally:runtime/src/coreclr/jit/morph.cpp
Lines 11190 to 11193 in 11bff1a
It means we end up evaluating the retbuf into a temp and stop being able to recognize it.
This seems to end up happening because in this case we have an
isTmplocal for the retbuf we are optimizing, and this local is address exposed besides as the ret buf:@kunalspathak said he would take a closer look.
Remove unnecessary GTF_GLOB_REF on locals
jakobbotsch commentedon May 1, 2022
#68741 at least fixes introducing the unnecessary temp which resolves the assert. However, I think we should leave this open just to investigate whether it is in general safe to do the ret buf optimization here. I suppose yes, since the local does end up marked as address exposed and will not actually be tracked.
I have attached a SPMI context for the compile where it happens which I collected on git hash 5c2a738 (with the fix from #68741 applied). The above tree comes from around line 4334 in the JIT dump.
context.zip
Remove GTF_GLOB_REF on a few more addressing nodes (#68741)