-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Update the place where we assert about align presence while removing jump to next instr
#95845
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
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsWe track the Fix the problem reported in #95729 (comment)
|
align presence while removing jump to next instr
|
@dotnet/jit-contrib |
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.
LGTM.
Does it mean this check for hasAlign() is unnecessary?
runtime/src/coreclr/jit/codegenlinear.cpp
Lines 747 to 751 in 69bbdb8
| // If a block was selected to place an alignment instruction because it ended | |
| // with a jump, do not remove jumps from such blocks. | |
| // Do not remove a jump between hot and cold regions. | |
| bool isRemovableJmpCandidate = | |
| !block->hasAlign() && !compiler->fgInDifferentRegions(block, block->GetTarget()); |
When I was looking at the issue I kind of got the feeling that this check is what normally filters out the case, but in this particular scenario didn't because we had two basic blocks mapped to the same IG.
ideally yes, that seems unnecessary. We will only attempt to remove the |
We track the
jmpinstructions in IG as potential candidate for removal, regardless of if the IG jumps to the next IG or if the IG contains alignment. InemitRemoveJumpToNextInst(), we first iterate over these candidatejmpinstructions and expect the IG shouldn't havealigninstruction, which is false. Only if the IG was marked asIGF_HAS_REMOVABLE_JMP, we should assert that it shouldn't end up withaligninstruction. Moved the assert at right place.Fix the problem reported in #95729 (comment)