-
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
JIT: Allow jump-to-next-block removal for blocks with alignment #97011
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5431,6 +5431,13 @@ PhaseStatus Compiler::placeLoopAlignInstructions() | |
bbHavingAlign = prev; | ||
JITDUMP("Marking " FMT_BB " before the loop with BBF_HAS_ALIGN for loop at " FMT_BB "\n", prev->bbNum, | ||
block->bbNum); | ||
|
||
// bbHavingAlign is in a loop, and precedes a nested loop | ||
if (blockToLoop->GetLoop(bbHavingAlign) != nullptr) | ||
{ | ||
// If bbHavingAlign is a removable jump, it will be removed despite it having alignment | ||
bbHavingAlign->SetFlags(BBF_JMP_TO_NESTED_LOOP); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I understand what we're trying to check here, but it doesn't seem to check for any form of nestedness or relationship between the two loops. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to check for examples like the one Kunal posted here, such that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, that case should definitely be caught but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
true, there could be occurrences where we do execute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I see, so we should also check that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think the current check is fine and we aren't really interested in nested loops vs top level loops -- just whether or not we are causing alignment to be executed in some other loop, which is what you're checking. To answer your question regardless, you could check it using the loop tree ( |
||
} | ||
else | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1971,7 +1971,7 @@ def replay_with_asm_diffs(self): | |
|
||
# These vars are force overridden in the SPMI runs for both the base and diff, always. | ||
replay_vars = { | ||
"DOTNET_JitAlignLoops": "0", # disable loop alignment to filter noise | ||
"DOTNET_JitAlignLoops": "1", # disable loop alignment to filter noise | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't check in this change |
||
"DOTNET_JitEnableNoWayAssert": "1", | ||
"DOTNET_JitNoForceFallback": "1", | ||
} | ||
|
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.
Please add a comment
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 plan to remove this flag before merging; this was just a quick-and-dirty way for determining when to remove a jump in a
BBJ_ALWAYS
block with alignment (to get the diffs Kunal wanted here).