-
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
Reset the bbNatLoopNum of block for removed loop #68804
Conversation
@dotnet/jit-contrib |
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsWhen a loop is removed, we should also reset the Fixes: #68769
|
I intentionally added an assert about But I also realized that we don't update the runtime/src/coreclr/jit/optimizer.cpp Lines 9587 to 9590 in 6111bc7
runtime/src/coreclr/jit/optimizer.cpp Lines 9537 to 9539 in 6111bc7
If we have live children, at the minimal, we should at least update the |
src/coreclr/jit/optimizer.cpp
Outdated
for (BasicBlock::loopNumber l = optLoopTable[loopNum].lpChild; // | ||
l != BasicBlock::NOT_IN_LOOP; // | ||
l = optLoopTable[l].lpSibling) | ||
{ | ||
if ((optLoopTable[l].lpFlags & LPFLG_REMOVED) == 0) | ||
{ | ||
JITDUMP("Resetting parent of loop number " FMT_LP " from " FMT_LP " to " FMT_LP ".\n", l, | ||
optLoopTable[l].lpParent, optLoopTable[loopNum].lpParent); | ||
optLoopTable[l].lpParent = optLoopTable[loopNum].lpParent; | ||
} | ||
} |
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.
for (BasicBlock::loopNumber l = optLoopTable[loopNum].lpChild; // | |
l != BasicBlock::NOT_IN_LOOP; // | |
l = optLoopTable[l].lpSibling) | |
{ | |
if ((optLoopTable[l].lpFlags & LPFLG_REMOVED) == 0) | |
{ | |
JITDUMP("Resetting parent of loop number " FMT_LP " from " FMT_LP " to " FMT_LP ".\n", l, | |
optLoopTable[l].lpParent, optLoopTable[loopNum].lpParent); | |
optLoopTable[l].lpParent = optLoopTable[loopNum].lpParent; | |
} | |
} | |
for (BasicBlock::loopNumber l = loop.lpChild; // | |
l != BasicBlock::NOT_IN_LOOP; // | |
l = optLoopTable[l].lpSibling) | |
{ | |
if ((optLoopTable[l].lpFlags & LPFLG_REMOVED) == 0) | |
{ | |
JITDUMP("Resetting parent of loop number " FMT_LP " from " FMT_LP " to " FMT_LP ".\n", l, | |
optLoopTable[l].lpParent, loop.lpParent); | |
optLoopTable[l].lpParent = loop.lpParent; | |
} | |
} |
When a loop is removed, we should also reset the
bbNatLoopNum
present at the blocks to reflect the updated information.Fixes: #68769