Skip to content

JIT: Remove Compiler::fgConnectFallThrough and BBJ_COND fix-ups in loop phases - #97191

Closed
amanasifkhalid wants to merge 15 commits into
dotnet:mainfrom
amanasifkhalid:nofallthrough
Closed

JIT: Remove Compiler::fgConnectFallThrough and BBJ_COND fix-ups in loop phases#97191
amanasifkhalid wants to merge 15 commits into
dotnet:mainfrom
amanasifkhalid:nofallthrough

Conversation

@amanasifkhalid

Copy link
Copy Markdown
Contributor

Next step for #93020. This removes the implicit fallthrough invariant for bbFalseTarget (as well as the corresponding logic for maintaining that invariant) from the loop representation. At this point, I noticed we can get rid of Compiler::fgConnectFallThrough, so I thought I'd include that in this change. There's still some cruft left in earlier phases for fixing up fallthrough into the false target with BBJ_ALWAYS blocks, but this PR is big enough -- I'll save the remaining cleanup for a follow-up PR.

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 19, 2024
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Next step for #93020. This removes the implicit fallthrough invariant for bbFalseTarget (as well as the corresponding logic for maintaining that invariant) from the loop representation. At this point, I noticed we can get rid of Compiler::fgConnectFallThrough, so I thought I'd include that in this change. There's still some cruft left in earlier phases for fixing up fallthrough into the false target with BBJ_ALWAYS blocks, but this PR is big enough -- I'll save the remaining cleanup for a follow-up PR.

Author:amanasifkhalid
Assignees:amanasifkhalid
Labels:

area-CodeGen-coreclr

Milestone:-

}

assert(ContainsBlock(cond->GetTrueTarget()) != ContainsBlock(cond->GetFalseTarget()));
// assert(ContainsBlock(cond->GetTrueTarget()) != ContainsBlock(cond->GetFalseTarget()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a correctness issue, but I have a local change that should make things work out even with your change here. Hopefully I'll get that in early next week.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! No rush on that

@amanasifkhalid

Copy link
Copy Markdown
ContributorAuthor

cc @dotnet/jit-contrib. I'm going to hold off on requesting reviews until I merge in the fix Jakob mentioned above. Diffs are pretty noisy -- lots of size improvements and regressions. I suspect we are encountering more false branches that don't fall through by the time we get to block reordering, creating more opportunities for behavioral diffs.

@amanasifkhalid

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr outerloop, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@amanasifkhalid

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr outerloop, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@amanasifkhalid

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr outerloop, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@kunalspathak

Copy link
Copy Markdown
Contributor
Diff results for #97191

Assembly diffs

Assembly diffs for linux/arm64 ran on windows/x64

Diffs are based on 2,501,660 contexts (1,003,806 MinOpts, 1,497,854 FullOpts).

MISSED contexts: base: 3,546 (0.14%), diff: 3,557 (0.14%)

Overall (-126,148 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.linux.arm64.checked.mch15,579,776+368
benchmarks.run_pgo.linux.arm64.checked.mch80,916,176-14,972
benchmarks.run_tiered.linux.arm64.checked.mch24,709,612-140
coreclr_tests.run.linux.arm64.checked.mch509,948,648-38,868
libraries.crossgen2.linux.arm64.checked.mch55,736,760+24
libraries.pmi.linux.arm64.checked.mch75,993,172-4,048
libraries_tests.run.linux.arm64.Release.mch381,327,700-46,900
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch162,523,364-21,244
realworld.run.linux.arm64.checked.mch15,906,968-172
smoke_tests.nativeaot.linux.arm64.checked.mch2,948,924-196
FullOpts (-126,148 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.linux.arm64.checked.mch15,276,768+368
benchmarks.run_pgo.linux.arm64.checked.mch55,979,716-14,972
benchmarks.run_tiered.linux.arm64.checked.mch4,924,756-140
coreclr_tests.run.linux.arm64.checked.mch160,723,592-38,868
libraries.crossgen2.linux.arm64.checked.mch55,735,124+24
libraries.pmi.linux.arm64.checked.mch75,873,188-4,048
libraries_tests.run.linux.arm64.Release.mch166,030,560-46,900
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch149,042,152-21,244
realworld.run.linux.arm64.checked.mch15,321,600-172
smoke_tests.nativeaot.linux.arm64.checked.mch2,947,976-196

Assembly diffs for linux/x64 ran on windows/x64

Diffs are based on 2,595,038 contexts (1,052,329 MinOpts, 1,542,709 FullOpts).

MISSED contexts: base: 3,596 (0.14%), diff: 3,597 (0.14%)

Overall (-208,870 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.linux.x64.checked.mch13,736,862+1,312
benchmarks.run_pgo.linux.x64.checked.mch66,799,627-28,244
benchmarks.run_tiered.linux.x64.checked.mch17,373,587+249
coreclr_tests.run.linux.x64.checked.mch458,880,954-56,518
libraries.crossgen2.linux.x64.checked.mch38,668,832-2,688
libraries.pmi.linux.x64.checked.mch59,972,991-4,424
libraries_tests.run.linux.x64.Release.mch329,976,844-101,989
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch130,000,373-12,847
realworld.run.linux.x64.checked.mch13,194,305-2,952
smoke_tests.nativeaot.linux.x64.checked.mch4,197,516-769
FullOpts (-208,870 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.linux.x64.checked.mch13,470,069+1,312
benchmarks.run_pgo.linux.x64.checked.mch46,969,870-28,244
benchmarks.run_tiered.linux.x64.checked.mch3,695,827+249
coreclr_tests.run.linux.x64.checked.mch132,322,819-56,518
libraries.crossgen2.linux.x64.checked.mch38,667,630-2,688
libraries.pmi.linux.x64.checked.mch59,860,121-4,424
libraries_tests.run.linux.x64.Release.mch145,587,323-101,989
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch119,341,902-12,847
realworld.run.linux.x64.checked.mch12,805,199-2,952
smoke_tests.nativeaot.linux.x64.checked.mch4,196,605-769

Assembly diffs for osx/arm64 ran on windows/x64

Diffs are based on 2,263,021 contexts (930,876 MinOpts, 1,332,145 FullOpts).

MISSED contexts: base: 2,925 (0.13%), diff: 2,944 (0.13%)

Overall (-97,340 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.osx.arm64.checked.mch11,180,924+420
benchmarks.run_pgo.osx.arm64.checked.mch34,573,260-1,928
benchmarks.run_tiered.osx.arm64.checked.mch15,560,360-236
coreclr_tests.run.osx.arm64.checked.mch485,472,376-37,636
libraries.crossgen2.osx.arm64.checked.mch55,620,836+20
libraries.pmi.osx.arm64.checked.mch79,955,312-916
libraries_tests.run.osx.arm64.Release.mch312,683,360-35,932
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch160,782,296-21,116
realworld.run.osx.arm64.checked.mch15,071,740-16
FullOpts (-97,340 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.osx.arm64.checked.mch11,180,388+420
benchmarks.run_pgo.osx.arm64.checked.mch18,099,980-1,928
benchmarks.run_tiered.osx.arm64.checked.mch4,045,284-236
coreclr_tests.run.osx.arm64.checked.mch153,165,920-37,636
libraries.crossgen2.osx.arm64.checked.mch55,619,208+20
libraries.pmi.osx.arm64.checked.mch79,834,184-916
libraries_tests.run.osx.arm64.Release.mch108,742,856-35,932
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch147,644,768-21,116
realworld.run.osx.arm64.checked.mch14,503,336-16

Assembly diffs for windows/arm64 ran on windows/x64

Diffs are based on 2,318,299 contexts (931,543 MinOpts, 1,386,756 FullOpts).

MISSED contexts: base: 2,587 (0.11%), diff: 2,595 (0.11%)

Overall (-117,288 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch10,964,120+384
benchmarks.run_pgo.windows.arm64.checked.mch47,218,960-7,024
benchmarks.run_tiered.windows.arm64.checked.mch15,346,624-268
coreclr_tests.run.windows.arm64.checked.mch495,323,188-40,444
libraries.crossgen2.windows.arm64.checked.mch58,963,476+48
libraries.pmi.windows.arm64.checked.mch79,565,936-3,548
libraries_tests.run.windows.arm64.Release.mch309,738,560-44,932
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch168,998,868-21,232
realworld.run.windows.arm64.checked.mch15,891,292-192
smoke_tests.nativeaot.windows.arm64.checked.mch3,972,452-80
FullOpts (-117,288 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch10,963,584+384
benchmarks.run_pgo.windows.arm64.checked.mch30,968,576-7,024
benchmarks.run_tiered.windows.arm64.checked.mch4,157,248-268
coreclr_tests.run.windows.arm64.checked.mch156,231,660-40,444
libraries.crossgen2.windows.arm64.checked.mch58,961,840+48
libraries.pmi.windows.arm64.checked.mch79,445,952-3,548
libraries_tests.run.windows.arm64.Release.mch108,157,056-44,932
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch155,861,404-21,232
realworld.run.windows.arm64.checked.mch15,322,868-192
smoke_tests.nativeaot.windows.arm64.checked.mch3,971,480-80

Assembly diffs for windows/x64 ran on windows/x64

Diffs are based on 2,492,951 contexts (983,689 MinOpts, 1,509,262 FullOpts).

MISSED contexts: base: 3,859 (0.15%), diff: 3,860 (0.15%)

Overall (-150,214 bytes)
CollectionBase size (bytes)Diff size (bytes)
aspnet.run.windows.x64.checked.mch41,763,246-11,556
benchmarks.run.windows.x64.checked.mch8,749,663+2,072
benchmarks.run_pgo.windows.x64.checked.mch34,741,684-7,152
benchmarks.run_tiered.windows.x64.checked.mch12,662,284+203
coreclr_tests.run.windows.x64.checked.mch392,866,349-60,805
libraries.crossgen2.windows.x64.checked.mch39,442,575-1,101
libraries.pmi.windows.x64.checked.mch61,196,926-3,050
libraries_tests.run.windows.x64.Release.mch279,034,285-53,914
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch133,435,993-11,707
realworld.run.windows.x64.checked.mch14,170,685-3,315
smoke_tests.nativeaot.windows.x64.checked.mch5,091,660+111
FullOpts (-150,214 bytes)
CollectionBase size (bytes)Diff size (bytes)
aspnet.run.windows.x64.checked.mch27,104,521-11,556
benchmarks.run.windows.x64.checked.mch8,749,302+2,072
benchmarks.run_pgo.windows.x64.checked.mch20,506,707-7,152
benchmarks.run_tiered.windows.x64.checked.mch3,477,018+203
coreclr_tests.run.windows.x64.checked.mch119,323,357-60,805
libraries.crossgen2.windows.x64.checked.mch39,441,386-1,101
libraries.pmi.windows.x64.checked.mch61,083,407-3,050
libraries_tests.run.windows.x64.Release.mch100,665,969-53,914
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch123,012,623-11,707
realworld.run.windows.x64.checked.mch13,780,980-3,315
smoke_tests.nativeaot.windows.x64.checked.mch5,090,751+111

Details here


Assembly diffs for linux/arm ran on windows/x86

Diffs are based on 2,238,225 contexts (827,812 MinOpts, 1,410,413 FullOpts).

MISSED contexts: base: 74,052 (3.20%), diff: 74,053 (3.20%)

Overall (-72,938 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.linux.arm.checked.mch15,304,692+962
benchmarks.run_pgo.linux.arm.checked.mch60,239,130-2,152
benchmarks.run_tiered.linux.arm.checked.mch22,645,104+672
coreclr_tests.run.linux.arm.checked.mch321,777,660-18,494
libraries.crossgen2.linux.arm.checked.mch35,174,904-1,196
libraries.pmi.linux.arm.checked.mch49,554,486-2,374
libraries_tests.run.linux.arm.Release.mch241,721,946-37,822
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch93,043,072-12,090
realworld.run.linux.arm.checked.mch13,613,084-444
FullOpts (-72,938 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.linux.arm.checked.mch14,915,436+962
benchmarks.run_pgo.linux.arm.checked.mch49,441,528-2,152
benchmarks.run_tiered.linux.arm.checked.mch13,537,948+672
coreclr_tests.run.linux.arm.checked.mch109,047,526-18,494
libraries.crossgen2.linux.arm.checked.mch35,173,674-1,196
libraries.pmi.linux.arm.checked.mch49,447,982-2,374
libraries_tests.run.linux.arm.Release.mch119,719,002-37,822
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch82,959,252-12,090
realworld.run.linux.arm.checked.mch13,163,138-444

Assembly diffs for windows/x86 ran on windows/x86

Diffs are based on 2,297,926 contexts (841,817 MinOpts, 1,456,109 FullOpts).

MISSED contexts: base: 2,090 (0.09%), diff: 3,444 (0.15%)

Overall (-179,094 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.windows.x86.checked.mch7,079,626+1,815
benchmarks.run_pgo.windows.x86.checked.mch43,693,213-14,646
benchmarks.run_tiered.windows.x86.checked.mch9,483,002+744
coreclr_tests.run.windows.x86.checked.mch308,689,527-81,235
libraries.crossgen2.windows.x86.checked.mch31,589,655-1,698
libraries.pmi.windows.x86.checked.mch48,705,820-7,539
libraries_tests.run.windows.x86.Release.mch185,057,062-59,640
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch102,009,413-13,900
realworld.run.windows.x86.checked.mch11,326,284-2,995
FullOpts (-179,094 bytes)
CollectionBase size (bytes)Diff size (bytes)
benchmarks.run.windows.x86.checked.mch7,079,347+1,815
benchmarks.run_pgo.windows.x86.checked.mch37,063,723-14,646
benchmarks.run_tiered.windows.x86.checked.mch5,213,193+744
coreclr_tests.run.windows.x86.checked.mch107,017,758-81,235
libraries.crossgen2.windows.x86.checked.mch31,588,598-1,698
libraries.pmi.windows.x86.checked.mch48,610,506-7,539
libraries_tests.run.windows.x86.Release.mch86,725,555-59,640
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch93,339,621-13,900
realworld.run.windows.x86.checked.mch11,030,584-2,995

Details here


Throughput diffs

Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.39% to -0.12%)
CollectionPDIFF
smoke_tests.nativeaot.linux.arm64.checked.mch-0.37%
libraries_tests.run.linux.arm64.Release.mch-0.39%
libraries.pmi.linux.arm64.checked.mch-0.33%
realworld.run.linux.arm64.checked.mch-0.35%
coreclr_tests.run.linux.arm64.checked.mch-0.12%
benchmarks.run_pgo.linux.arm64.checked.mch-0.38%
libraries.crossgen2.linux.arm64.checked.mch-0.16%
benchmarks.run_tiered.linux.arm64.checked.mch-0.20%
benchmarks.run.linux.arm64.checked.mch-0.30%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.29%
FullOpts (-0.52% to -0.16%)
CollectionPDIFF
smoke_tests.nativeaot.linux.arm64.checked.mch-0.37%
libraries_tests.run.linux.arm64.Release.mch-0.52%
libraries.pmi.linux.arm64.checked.mch-0.33%
realworld.run.linux.arm64.checked.mch-0.36%
coreclr_tests.run.linux.arm64.checked.mch-0.23%
benchmarks.run_pgo.linux.arm64.checked.mch-0.42%
libraries.crossgen2.linux.arm64.checked.mch-0.16%
benchmarks.run_tiered.linux.arm64.checked.mch-0.42%
benchmarks.run.linux.arm64.checked.mch-0.30%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.30%

Throughput diffs for linux/x64 ran on linux/x64

Overall (-0.42% to -0.14%)
CollectionPDIFF
realworld.run.linux.x64.checked.mch-0.37%
libraries.pmi.linux.x64.checked.mch-0.34%
coreclr_tests.run.linux.x64.checked.mch-0.14%
benchmarks.run_pgo.linux.x64.checked.mch-0.40%
smoke_tests.nativeaot.linux.x64.checked.mch-0.42%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.30%
benchmarks.run.linux.x64.checked.mch-0.30%
libraries_tests.run.linux.x64.Release.mch-0.41%
benchmarks.run_tiered.linux.x64.checked.mch-0.23%
libraries.crossgen2.linux.x64.checked.mch-0.19%
FullOpts (-0.54% to -0.19%)
CollectionPDIFF
realworld.run.linux.x64.checked.mch-0.37%
libraries.pmi.linux.x64.checked.mch-0.34%
coreclr_tests.run.linux.x64.checked.mch-0.26%
benchmarks.run_pgo.linux.x64.checked.mch-0.45%
smoke_tests.nativeaot.linux.x64.checked.mch-0.42%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.31%
benchmarks.run.linux.x64.checked.mch-0.30%
libraries_tests.run.linux.x64.Release.mch-0.54%
benchmarks.run_tiered.linux.x64.checked.mch-0.43%
libraries.crossgen2.linux.x64.checked.mch-0.19%

Details here


Throughput diffs for linux/arm ran on windows/x86

Overall (-0.49% to -0.07%)
CollectionPDIFF
benchmarks.run.linux.arm.checked.mch-0.14%
benchmarks.run_pgo.linux.arm.checked.mch-0.09%
benchmarks.run_tiered.linux.arm.checked.mch-0.11%
coreclr_tests.run.linux.arm.checked.mch-0.13%
libraries.crossgen2.linux.arm.checked.mch-0.07%
libraries.pmi.linux.arm.checked.mch-0.20%
libraries_tests.run.linux.arm.Release.mch-0.19%
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch-0.20%
realworld.run.linux.arm.checked.mch-0.49%
MinOpts (+0.02% to +0.06%)
CollectionPDIFF
benchmarks.run.linux.arm.checked.mch+0.03%
benchmarks.run_pgo.linux.arm.checked.mch+0.04%
benchmarks.run_tiered.linux.arm.checked.mch+0.03%
coreclr_tests.run.linux.arm.checked.mch+0.03%
libraries.crossgen2.linux.arm.checked.mch+0.05%
libraries.pmi.linux.arm.checked.mch+0.06%
libraries_tests.run.linux.arm.Release.mch+0.02%
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch+0.05%
realworld.run.linux.arm.checked.mch+0.04%
FullOpts (-0.49% to -0.07%)
CollectionPDIFF
benchmarks.run.linux.arm.checked.mch-0.14%
benchmarks.run_pgo.linux.arm.checked.mch-0.10%
benchmarks.run_tiered.linux.arm.checked.mch-0.14%
coreclr_tests.run.linux.arm.checked.mch-0.25%
libraries.crossgen2.linux.arm.checked.mch-0.07%
libraries.pmi.linux.arm.checked.mch-0.20%
libraries_tests.run.linux.arm.Release.mch-0.26%
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch-0.21%
realworld.run.linux.arm.checked.mch-0.49%

Throughput diffs for windows/x86 ran on windows/x86

Overall (-0.31% to -0.09%)
CollectionPDIFF
benchmarks.run.windows.x86.checked.mch-0.28%
benchmarks.run_pgo.windows.x86.checked.mch-0.31%
benchmarks.run_tiered.windows.x86.checked.mch-0.27%
coreclr_tests.run.windows.x86.checked.mch-0.11%
libraries.crossgen2.windows.x86.checked.mch-0.09%
libraries.pmi.windows.x86.checked.mch-0.21%
libraries_tests.run.windows.x86.Release.mch-0.24%
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch-0.17%
realworld.run.windows.x86.checked.mch-0.21%
MinOpts (+0.03% to +0.10%)
CollectionPDIFF
benchmarks.run.windows.x86.checked.mch+0.03%
benchmarks.run_pgo.windows.x86.checked.mch+0.05%
benchmarks.run_tiered.windows.x86.checked.mch+0.05%
coreclr_tests.run.windows.x86.checked.mch+0.03%
libraries.crossgen2.windows.x86.checked.mch+0.04%
libraries.pmi.windows.x86.checked.mch+0.10%
libraries_tests.run.windows.x86.Release.mch+0.03%
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch+0.05%
realworld.run.windows.x86.checked.mch+0.05%
FullOpts (-0.33% to -0.09%)
CollectionPDIFF
benchmarks.run.windows.x86.checked.mch-0.28%
benchmarks.run_pgo.windows.x86.checked.mch-0.32%
benchmarks.run_tiered.windows.x86.checked.mch-0.33%
coreclr_tests.run.windows.x86.checked.mch-0.19%
libraries.crossgen2.windows.x86.checked.mch-0.09%
libraries.pmi.windows.x86.checked.mch-0.21%
libraries_tests.run.windows.x86.Release.mch-0.32%
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch-0.18%
realworld.run.windows.x86.checked.mch-0.22%

Details here


Throughput diffs for linux/arm64 ran on windows/x64

Overall (-0.35% to -0.11%)
CollectionPDIFF
benchmarks.run.linux.arm64.checked.mch-0.27%
benchmarks.run_pgo.linux.arm64.checked.mch-0.32%
benchmarks.run_tiered.linux.arm64.checked.mch-0.18%
coreclr_tests.run.linux.arm64.checked.mch-0.11%
libraries.crossgen2.linux.arm64.checked.mch-0.13%
libraries.pmi.linux.arm64.checked.mch-0.30%
libraries_tests.run.linux.arm64.Release.mch-0.35%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.26%
realworld.run.linux.arm64.checked.mch-0.34%
smoke_tests.nativeaot.linux.arm64.checked.mch-0.32%
MinOpts (-0.01% to -0.00%)
CollectionPDIFF
libraries.crossgen2.linux.arm64.checked.mch-0.01%
FullOpts (-0.48% to -0.13%)
CollectionPDIFF
benchmarks.run.linux.arm64.checked.mch-0.27%
benchmarks.run_pgo.linux.arm64.checked.mch-0.36%
benchmarks.run_tiered.linux.arm64.checked.mch-0.38%
coreclr_tests.run.linux.arm64.checked.mch-0.20%
libraries.crossgen2.linux.arm64.checked.mch-0.13%
libraries.pmi.linux.arm64.checked.mch-0.30%
libraries_tests.run.linux.arm64.Release.mch-0.48%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.27%
realworld.run.linux.arm64.checked.mch-0.34%
smoke_tests.nativeaot.linux.arm64.checked.mch-0.32%

Throughput diffs for linux/x64 ran on windows/x64

Overall (-0.37% to -0.13%)
CollectionPDIFF
benchmarks.run.linux.x64.checked.mch-0.26%
benchmarks.run_pgo.linux.x64.checked.mch-0.34%
benchmarks.run_tiered.linux.x64.checked.mch-0.21%
coreclr_tests.run.linux.x64.checked.mch-0.13%
libraries.crossgen2.linux.x64.checked.mch-0.15%
libraries.pmi.linux.x64.checked.mch-0.31%
libraries_tests.run.linux.x64.Release.mch-0.37%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.27%
realworld.run.linux.x64.checked.mch-0.35%
smoke_tests.nativeaot.linux.x64.checked.mch-0.36%
MinOpts (-0.01% to +0.00%)
CollectionPDIFF
benchmarks.run.linux.x64.checked.mch-0.01%
benchmarks.run_pgo.linux.x64.checked.mch-0.01%
libraries.crossgen2.linux.x64.checked.mch-0.01%
FullOpts (-0.48% to -0.15%)
CollectionPDIFF
benchmarks.run.linux.x64.checked.mch-0.26%
benchmarks.run_pgo.linux.x64.checked.mch-0.37%
benchmarks.run_tiered.linux.x64.checked.mch-0.38%
coreclr_tests.run.linux.x64.checked.mch-0.22%
libraries.crossgen2.linux.x64.checked.mch-0.15%
libraries.pmi.linux.x64.checked.mch-0.31%
libraries_tests.run.linux.x64.Release.mch-0.48%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.28%
realworld.run.linux.x64.checked.mch-0.35%
smoke_tests.nativeaot.linux.x64.checked.mch-0.36%

Throughput diffs for osx/arm64 ran on windows/x64

Overall (-0.36% to -0.11%)
CollectionPDIFF
benchmarks.run.osx.arm64.checked.mch-0.36%
benchmarks.run_pgo.osx.arm64.checked.mch-0.33%
benchmarks.run_tiered.osx.arm64.checked.mch-0.22%
coreclr_tests.run.osx.arm64.checked.mch-0.11%
libraries.crossgen2.osx.arm64.checked.mch-0.13%
libraries.pmi.osx.arm64.checked.mch-0.29%
libraries_tests.run.osx.arm64.Release.mch-0.31%
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch-0.25%
realworld.run.osx.arm64.checked.mch-0.34%
MinOpts (-0.01% to +0.00%)
CollectionPDIFF
benchmarks.run_pgo.osx.arm64.checked.mch-0.01%
libraries.crossgen2.osx.arm64.checked.mch-0.01%
FullOpts (-0.47% to -0.13%)
CollectionPDIFF
benchmarks.run.osx.arm64.checked.mch-0.36%
benchmarks.run_pgo.osx.arm64.checked.mch-0.41%
benchmarks.run_tiered.osx.arm64.checked.mch-0.39%
coreclr_tests.run.osx.arm64.checked.mch-0.19%
libraries.crossgen2.osx.arm64.checked.mch-0.13%
libraries.pmi.osx.arm64.checked.mch-0.29%
libraries_tests.run.osx.arm64.Release.mch-0.47%
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch-0.26%
realworld.run.osx.arm64.checked.mch-0.34%

Throughput diffs for windows/arm64 ran on windows/x64

Overall (-0.38% to -0.12%)
CollectionPDIFF
benchmarks.run.windows.arm64.checked.mch-0.36%
benchmarks.run_pgo.windows.arm64.checked.mch-0.38%
benchmarks.run_tiered.windows.arm64.checked.mch-0.23%
coreclr_tests.run.windows.arm64.checked.mch-0.12%
libraries.crossgen2.windows.arm64.checked.mch-0.13%
libraries.pmi.windows.arm64.checked.mch-0.28%
libraries_tests.run.windows.arm64.Release.mch-0.32%
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch-0.24%
realworld.run.windows.arm64.checked.mch-0.29%
smoke_tests.nativeaot.windows.arm64.checked.mch-0.35%
MinOpts (-0.01% to +0.00%)
CollectionPDIFF
benchmarks.run_pgo.windows.arm64.checked.mch-0.01%
libraries.crossgen2.windows.arm64.checked.mch-0.01%
FullOpts (-0.49% to -0.13%)
CollectionPDIFF
benchmarks.run.windows.arm64.checked.mch-0.36%
benchmarks.run_pgo.windows.arm64.checked.mch-0.43%
benchmarks.run_tiered.windows.arm64.checked.mch-0.40%
coreclr_tests.run.windows.arm64.checked.mch-0.20%
libraries.crossgen2.windows.arm64.checked.mch-0.13%
libraries.pmi.windows.arm64.checked.mch-0.29%
libraries_tests.run.windows.arm64.Release.mch-0.49%
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch-0.24%
realworld.run.windows.arm64.checked.mch-0.30%
smoke_tests.nativeaot.windows.arm64.checked.mch-0.35%

Throughput diffs for windows/x64 ran on windows/x64

Overall (-0.45% to -0.14%)
CollectionPDIFF
aspnet.run.windows.x64.checked.mch-0.45%
benchmarks.run.windows.x64.checked.mch-0.36%
benchmarks.run_pgo.windows.x64.checked.mch-0.36%
benchmarks.run_tiered.windows.x64.checked.mch-0.23%
coreclr_tests.run.windows.x64.checked.mch-0.14%
libraries.crossgen2.windows.x64.checked.mch-0.15%
libraries.pmi.windows.x64.checked.mch-0.30%
libraries_tests.run.windows.x64.Release.mch-0.35%
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch-0.24%
realworld.run.windows.x64.checked.mch-0.29%
smoke_tests.nativeaot.windows.x64.checked.mch-0.37%
MinOpts (-0.01% to -0.00%)
CollectionPDIFF
aspnet.run.windows.x64.checked.mch-0.01%
benchmarks.run_pgo.windows.x64.checked.mch-0.01%
libraries.crossgen2.windows.x64.checked.mch-0.01%
FullOpts (-0.51% to -0.15%)
CollectionPDIFF
aspnet.run.windows.x64.checked.mch-0.51%
benchmarks.run.windows.x64.checked.mch-0.36%
benchmarks.run_pgo.windows.x64.checked.mch-0.42%
benchmarks.run_tiered.windows.x64.checked.mch-0.38%
coreclr_tests.run.windows.x64.checked.mch-0.23%
libraries.crossgen2.windows.x64.checked.mch-0.15%
libraries.pmi.windows.x64.checked.mch-0.30%
libraries_tests.run.windows.x64.Release.mch-0.49%
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch-0.25%
realworld.run.windows.x64.checked.mch-0.29%
smoke_tests.nativeaot.windows.x64.checked.mch-0.37%

Details here


@kunalspathak

Copy link
Copy Markdown
Contributor
Diff results for #97191

Throughput diffs

Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.34% to -0.10%)
CollectionPDIFF
coreclr_tests.run.linux.arm64.checked.mch-0.10%
benchmarks.run.linux.arm64.checked.mch-0.24%
benchmarks.run_tiered.linux.arm64.checked.mch-0.16%
libraries.crossgen2.linux.arm64.checked.mch-0.12%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.24%
benchmarks.run_pgo.linux.arm64.checked.mch-0.30%
smoke_tests.nativeaot.linux.arm64.checked.mch-0.31%
libraries.pmi.linux.arm64.checked.mch-0.27%
libraries_tests.run.linux.arm64.Release.mch-0.34%
realworld.run.linux.arm64.checked.mch-0.30%
FullOpts (-0.45% to -0.12%)
CollectionPDIFF
coreclr_tests.run.linux.arm64.checked.mch-0.19%
benchmarks.run.linux.arm64.checked.mch-0.24%
benchmarks.run_tiered.linux.arm64.checked.mch-0.35%
libraries.crossgen2.linux.arm64.checked.mch-0.12%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.25%
benchmarks.run_pgo.linux.arm64.checked.mch-0.34%
smoke_tests.nativeaot.linux.arm64.checked.mch-0.31%
libraries.pmi.linux.arm64.checked.mch-0.27%
libraries_tests.run.linux.arm64.Release.mch-0.45%
realworld.run.linux.arm64.checked.mch-0.30%

Throughput diffs for linux/x64 ran on linux/x64

Overall (-0.35% to -0.12%)
CollectionPDIFF
benchmarks.run_pgo.linux.x64.checked.mch-0.32%
libraries.crossgen2.linux.x64.checked.mch-0.14%
benchmarks.run_tiered.linux.x64.checked.mch-0.19%
realworld.run.linux.x64.checked.mch-0.31%
benchmarks.run.linux.x64.checked.mch-0.24%
smoke_tests.nativeaot.linux.x64.checked.mch-0.35%
coreclr_tests.run.linux.x64.checked.mch-0.12%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.25%
libraries.pmi.linux.x64.checked.mch-0.28%
libraries_tests.run.linux.x64.Release.mch-0.35%
FullOpts (-0.46% to -0.14%)
CollectionPDIFF
benchmarks.run_pgo.linux.x64.checked.mch-0.36%
libraries.crossgen2.linux.x64.checked.mch-0.14%
benchmarks.run_tiered.linux.x64.checked.mch-0.36%
realworld.run.linux.x64.checked.mch-0.31%
benchmarks.run.linux.x64.checked.mch-0.24%
smoke_tests.nativeaot.linux.x64.checked.mch-0.35%
coreclr_tests.run.linux.x64.checked.mch-0.22%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.26%
libraries.pmi.linux.x64.checked.mch-0.28%
libraries_tests.run.linux.x64.Release.mch-0.46%

Details here


@ryujit-bot

Copy link
Copy Markdown
Diff results for #97191

Throughput diffs

Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.34% to -0.10%)
CollectionPDIFF
coreclr_tests.run.linux.arm64.checked.mch-0.10%
benchmarks.run.linux.arm64.checked.mch-0.24%
benchmarks.run_tiered.linux.arm64.checked.mch-0.16%
libraries.crossgen2.linux.arm64.checked.mch-0.12%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.24%
benchmarks.run_pgo.linux.arm64.checked.mch-0.30%
smoke_tests.nativeaot.linux.arm64.checked.mch-0.31%
libraries.pmi.linux.arm64.checked.mch-0.27%
libraries_tests.run.linux.arm64.Release.mch-0.34%
realworld.run.linux.arm64.checked.mch-0.30%
FullOpts (-0.45% to -0.12%)
CollectionPDIFF
coreclr_tests.run.linux.arm64.checked.mch-0.19%
benchmarks.run.linux.arm64.checked.mch-0.24%
benchmarks.run_tiered.linux.arm64.checked.mch-0.35%
libraries.crossgen2.linux.arm64.checked.mch-0.12%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch-0.25%
benchmarks.run_pgo.linux.arm64.checked.mch-0.34%
smoke_tests.nativeaot.linux.arm64.checked.mch-0.31%
libraries.pmi.linux.arm64.checked.mch-0.27%
libraries_tests.run.linux.arm64.Release.mch-0.45%
realworld.run.linux.arm64.checked.mch-0.30%

Throughput diffs for linux/x64 ran on linux/x64

Overall (-0.35% to -0.12%)
CollectionPDIFF
benchmarks.run_pgo.linux.x64.checked.mch-0.32%
libraries.crossgen2.linux.x64.checked.mch-0.14%
benchmarks.run_tiered.linux.x64.checked.mch-0.19%
realworld.run.linux.x64.checked.mch-0.31%
benchmarks.run.linux.x64.checked.mch-0.24%
smoke_tests.nativeaot.linux.x64.checked.mch-0.35%
coreclr_tests.run.linux.x64.checked.mch-0.12%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.25%
libraries.pmi.linux.x64.checked.mch-0.28%
libraries_tests.run.linux.x64.Release.mch-0.35%
FullOpts (-0.46% to -0.14%)
CollectionPDIFF
benchmarks.run_pgo.linux.x64.checked.mch-0.36%
libraries.crossgen2.linux.x64.checked.mch-0.14%
benchmarks.run_tiered.linux.x64.checked.mch-0.36%
realworld.run.linux.x64.checked.mch-0.31%
benchmarks.run.linux.x64.checked.mch-0.24%
smoke_tests.nativeaot.linux.x64.checked.mch-0.35%
coreclr_tests.run.linux.x64.checked.mch-0.22%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch-0.26%
libraries.pmi.linux.x64.checked.mch-0.28%
libraries_tests.run.linux.x64.Release.mch-0.46%

Details here


Comment on lines +5137 to +5158
// Block layout should not change at this point.
// Do one last pass to reverse any conditions that might yield more fall-through branches.
if (opts.OptimizationEnabled())
{
for (BasicBlock* const block : Blocks())
{
if (block->KindIs(BBJ_COND) && block->CanRemoveJumpToTarget(block->GetTrueTarget(), this))
{
// Reverse the jump condition
GenTree* test = block->lastNode();
assert(test->OperIsConditionalJump());
GenTree* cond = gtReverseCond(test);
assert(cond == test); // Ensure `gtReverseCond` did not create a new node.

BasicBlock* newFalseTarget = block->GetTrueTarget();
BasicBlock* newTrueTarget = block->GetFalseTarget();
block->SetTrueTarget(newTrueTarget);
block->SetFalseTarget(newFalseTarget);
assert(block->CanRemoveJumpToTarget(newFalseTarget, this));
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a proper phase ensuring post-phase checks run, and ensuring the changed IR nodes are dumped.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning on removing this change from this PR, and possibly introducing it if/when we remove the condition reversals done in earlier phases. I'll add it as a new phase then.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good... sorry about the draft review.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! I appreciate the feedback -- this should be ready soon.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ready soon.

Famous last words... closing this in favor of #97488.

amanasifkhalid added a commit that referenced this pull request Jan 29, 2024
Part of #93020. This change adds back in most of #97191 and #96609, except for any significant changes to the flowgraph optimization passes to reduce churn. With this change, the false target of a BBJ_COND can diverge from the next block until Compiler::optOptimizeLayout, in which we reestablish implicit fall-through with fgConnectFallThrough to preserve the existing block reordering behavior. Note that the deferral of these fall-through fixups causes diffs in the edge weights, which can alter the behavior of fgReorderBlocks, hence some of the size regressions
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Feb 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@amanasifkhalid@kunalspathak@ryujit-bot@jakobbotsch