-
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: Extraneous jumps around alignment in some cases after BBJ_NONE
removal
#96998
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Comments
dotnet-issue-labeler
bot
added
the
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
label
Jan 15, 2024
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsSimple case from @EgorBo: public static void Foo()
{
Foo();
} Before #94239: G_M24659_IG01: ;; offset=0x0000
;; size=0 bbWeight=1 PerfScore 0.00
G_M24659_IG02: ;; offset=0x0000
align [0 bytes for IG03]
;; size=0 bbWeight=1 PerfScore 0.00
G_M24659_IG03: ;; offset=0x0000
jmp SHORT G_M24659_IG03
;; size=2 bbWeight=8 PerfScore 16.00
; Total bytes of code 2, prolog size 0, PerfScore 16.20, instruction count 2, allocated bytes for code 2 (MethodHash=999a9fac) for method Program:Foo() (FullOpts) (IG03 correctly aligned) After #94239: G_M24659_IG01: ;; offset=0x0000
;; size=0 bbWeight=1 PerfScore 0.00
G_M24659_IG02: ;; offset=0x0000
jmp SHORT G_M24659_IG03
align [0 bytes for IG03]
;; size=2 bbWeight=1 PerfScore 2.00
G_M24659_IG03: ;; offset=0x0002
jmp SHORT G_M24659_IG03
;; size=2 bbWeight=8 PerfScore 16.00
; Total bytes of code 4, prolog size 0, PerfScore 18.40, instruction count 3, allocated bytes for code 4 (MethodHash=999a9fac) for method Program:Foo() (FullOpts) (IG03 not correctly aligned) cc @dotnet/jit-contrib @amanasifkhalid
|
ghost
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jan 15, 2024
jakobbotsch
changed the title
JIT: Loop alignment is computed incorrectly in some cases after
JIT: Extraneous jumps around alignment in some cases after Jan 16, 2024
BBJ_NONE
removalBBJ_NONE
removal
amanasifkhalid
added a commit
that referenced
this issue
Feb 2, 2024
Fixes #96998. The jump-to-next-block removal optimization currently passes on jumps with alignment padding behind them (see BasicBlock::CanRemoveJumpToNext). While our alignment placement strategy does not consider blocks with jumps that will be removed, it is possible for such a block to be chosen if it precedes the start of the loop being aligned. This alignment decision blocks the jump from being removed. Under normal circumstances, it should be fine to remove such jumps, and just fall through the alignment padding into the next block, but JitStress might decide to place breakpoint instructions in these alignment areas if behind a jump. So in debug builds, we now tell emitter::emitLoopAlignment if the jump was removed so JitStress does not consider placing breakpoints in the alignment padding.
ghost
removed
the
in-pr
There is an active PR which will close this issue when it is merged
label
Feb 2, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Simple case from @EgorBo:
Before #94239:
After #94239:
cc @dotnet/jit-contrib @amanasifkhalid
The text was updated successfully, but these errors were encountered: