Use impInlineRoot()->compIsAsync() in fgGetStaticsCCtorHelper#130536
Use impInlineRoot()->compIsAsync() in fgGetStaticsCCtorHelper#130536jakobbotsch with Copilot wants to merge 1 commit into
Conversation
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
|
/azp run runtime-coreclr jitstress |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR fixes an inlining-context bug in the JIT’s fgGetStaticsCCtorHelper helper typing logic by ensuring the “is async” predicate is evaluated on the inline root compiler, not the current (possibly-inlinee) compiler.
Changes:
- Switch the pinned statics base helper return type decision from
compIsAsync()toimpInlineRoot()->compIsAsync()so inlinees imported into async roots get the intendedTYP_BYREFtyping.
|
/azp run runtime-coreclr jitstress |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| // ensuring derived addresses are byref typed and are treated | ||
| // similarly. | ||
| type = compIsAsync() ? TYP_BYREF : TYP_I_IMPL; | ||
| type = impInlineRoot()->compIsAsync() ? TYP_BYREF : TYP_I_IMPL; |
There was a problem hiding this comment.
You might want to do this inside compIsAsync; I do this sort of thing elsewhere in the JIT, for things like this that might be called in early phases.
There was a problem hiding this comment.
Often we don't actually want this to be true inside the inlinee unless the inlinee is itself async. But this case is an exception.
fgGetStaticsCCtorHelpertypes the pinned statics base helpers asTYP_BYREFin async methods so they get "killed across suspensions" behavior and byref-typed derived addresses. The async predicate usedcompIsAsync(), which reflects the current Compiler rather than the root being compiled — so an inlinee imported into an async root (the inlinee is not itself async) could be mistyped asTYP_I_IMPL.src/coreclr/jit/flowgraph.cpp: route the async check through the inline root:type = impInlineRoot()->compIsAsync() ? TYP_BYREF : TYP_I_IMPL;