-
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: Update IL offsets in fgExpandStaticInitForCall
#99662
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
src/coreclr/jit/fgbasic.cpp
Outdated
|
||
IL_OFFSET splitPointILOffset = fgFindBlockILOffset(newBlock); | ||
IL_OFFSET splitPointILOffset = fgFindBlockILOffset(newBlock); |
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.
Instead of doing the if (!newBlock->HasFlag(BBF_INTERNAL))
check, I was debating whether or not fgFindBlockILOffset
should always return BAD_IL_OFFSET
because it currently will not.
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.
Is this the place that caused trouble? Because the before logic seemed ok.
// cc @dotnet/jit-contrib @AndyAyersMS @jakobbotsch |
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.
Still not sure about this... left some notes over in #99543
src/coreclr/jit/fgbasic.cpp
Outdated
|
||
IL_OFFSET splitPointILOffset = fgFindBlockILOffset(newBlock); | ||
IL_OFFSET splitPointILOffset = fgFindBlockILOffset(newBlock); |
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.
Is this the place that caused trouble? Because the before logic seemed ok.
src/coreclr/jit/fgbasic.cpp
Outdated
@@ -6124,10 +6127,10 @@ BasicBlock* Compiler::fgNewBBFromTreeAfter( | |||
{ | |||
BasicBlock* newBlock = fgNewBBafter(jumpKind, block, true); | |||
newBlock->SetFlags(BBF_INTERNAL); | |||
assert(newBlock->bbCodeOffs == BAD_IL_OFFSET); | |||
assert(newBlock->bbCodeOffsEnd == BAD_IL_OFFSET); |
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.
I would actually give this the same logic as above, use fgFindBlockILOffset
to figure out the proper offsets, if any.
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.
Should we do that for BBF_INTERNAL
blocks?
Yes. If |
block->bbCodeOffsEnd
to BAD_IL_OFFSET when expanding static init for calls
…block had a valid ending offset
block->bbCodeOffsEnd
to BAD_IL_OFFSET when expanding static init for callsfgSplitBlockAfterStatement
if the original block's ending offset was BAD_IL_OFFSET
fgSplitBlockAfterStatement
if the original block's ending offset was BAD_IL_OFFSETfgExpandStaticInitForCall
Will resolve #99543
See comment for more details.