Skip to content

JIT: Extraneous jumps around alignment in some cases after BBJ_NONE removal #96998

@jakobbotsch

Description

@jakobbotsch

Simple 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)

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)

cc @dotnet/jit-contrib @amanasifkhalid

Metadata

Metadata

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions