-
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
Force new label after IG that ends with align instruction #62025
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsSometimes, we might end up having 2 assert(needLabel || ((block->bbPrev->bbJumpKind == BBJ_ALWAYS) && (block->bbJumpKind == BBJ_ALWAYS))); E97AFFFFFF jmp G_M22669_IG12
E9A0060000 jmp G_M22669_IG78
|
@dotnet/jit-contrib @BruceForstall |
@kunalspathak Can you explain how we can get back-to-back |
That magic happens when we decide to "Conditionally fold" a basic block, but while doing that, do not check if previous block also had an unconditional jump. Initial flow:
During conditional folding of jumps, we do this:
which transforms the flow to:
We also optimize and remove During codegen, we get this:
So yes, the second |
Sometimes, we might end up having 2
jmp
instructions as part of same block and we might prefer to addalign
instruction after the 1st jump but then we would assert that there is no label present. I can update the assert condition to something like below, but I think proper fix would be to setneedLabel = true
in such cases.assert(needLabel || ((block->bbPrev->bbJumpKind == BBJ_ALWAYS) && (block->bbJumpKind == BBJ_ALWAYS)));
Fixes: #61939