Skip to content
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: Remove Compiler::fgConnectFallThrough and BBJ_COND fix-ups in loop phases #97191

Closed
wants to merge 15 commits into from

Conversation

amanasifkhalid
Copy link
Member

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.

@ghost ghost assigned amanasifkhalid Jan 19, 2024
@dotnet-issue-labeler 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 19, 2024
@ghost
Copy link

ghost commented Jan 19, 2024

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: -

@@ -4988,7 +4987,7 @@ bool FlowGraphNaturalLoop::AnalyzeIteration(NaturalLoopIterInfo* info)
return false;
}

assert(ContainsBlock(cond->GetTrueTarget()) != ContainsBlock(cond->GetFalseTarget()));
// assert(ContainsBlock(cond->GetTrueTarget()) != ContainsBlock(cond->GetFalseTarget()));
Copy link
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
Member Author

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
Member Author

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
Member Author

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

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@amanasifkhalid
Copy link
Member Author

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

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@amanasifkhalid
Copy link
Member Author

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

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@kunalspathak
Copy link
Member

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)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm64.checked.mch 15,579,776 +368
benchmarks.run_pgo.linux.arm64.checked.mch 80,916,176 -14,972
benchmarks.run_tiered.linux.arm64.checked.mch 24,709,612 -140
coreclr_tests.run.linux.arm64.checked.mch 509,948,648 -38,868
libraries.crossgen2.linux.arm64.checked.mch 55,736,760 +24
libraries.pmi.linux.arm64.checked.mch 75,993,172 -4,048
libraries_tests.run.linux.arm64.Release.mch 381,327,700 -46,900
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch 162,523,364 -21,244
realworld.run.linux.arm64.checked.mch 15,906,968 -172
smoke_tests.nativeaot.linux.arm64.checked.mch 2,948,924 -196
FullOpts (-126,148 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm64.checked.mch 15,276,768 +368
benchmarks.run_pgo.linux.arm64.checked.mch 55,979,716 -14,972
benchmarks.run_tiered.linux.arm64.checked.mch 4,924,756 -140
coreclr_tests.run.linux.arm64.checked.mch 160,723,592 -38,868
libraries.crossgen2.linux.arm64.checked.mch 55,735,124 +24
libraries.pmi.linux.arm64.checked.mch 75,873,188 -4,048
libraries_tests.run.linux.arm64.Release.mch 166,030,560 -46,900
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch 149,042,152 -21,244
realworld.run.linux.arm64.checked.mch 15,321,600 -172
smoke_tests.nativeaot.linux.arm64.checked.mch 2,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)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.x64.checked.mch 13,736,862 +1,312
benchmarks.run_pgo.linux.x64.checked.mch 66,799,627 -28,244
benchmarks.run_tiered.linux.x64.checked.mch 17,373,587 +249
coreclr_tests.run.linux.x64.checked.mch 458,880,954 -56,518
libraries.crossgen2.linux.x64.checked.mch 38,668,832 -2,688
libraries.pmi.linux.x64.checked.mch 59,972,991 -4,424
libraries_tests.run.linux.x64.Release.mch 329,976,844 -101,989
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch 130,000,373 -12,847
realworld.run.linux.x64.checked.mch 13,194,305 -2,952
smoke_tests.nativeaot.linux.x64.checked.mch 4,197,516 -769
FullOpts (-208,870 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.x64.checked.mch 13,470,069 +1,312
benchmarks.run_pgo.linux.x64.checked.mch 46,969,870 -28,244
benchmarks.run_tiered.linux.x64.checked.mch 3,695,827 +249
coreclr_tests.run.linux.x64.checked.mch 132,322,819 -56,518
libraries.crossgen2.linux.x64.checked.mch 38,667,630 -2,688
libraries.pmi.linux.x64.checked.mch 59,860,121 -4,424
libraries_tests.run.linux.x64.Release.mch 145,587,323 -101,989
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch 119,341,902 -12,847
realworld.run.linux.x64.checked.mch 12,805,199 -2,952
smoke_tests.nativeaot.linux.x64.checked.mch 4,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)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.osx.arm64.checked.mch 11,180,924 +420
benchmarks.run_pgo.osx.arm64.checked.mch 34,573,260 -1,928
benchmarks.run_tiered.osx.arm64.checked.mch 15,560,360 -236
coreclr_tests.run.osx.arm64.checked.mch 485,472,376 -37,636
libraries.crossgen2.osx.arm64.checked.mch 55,620,836 +20
libraries.pmi.osx.arm64.checked.mch 79,955,312 -916
libraries_tests.run.osx.arm64.Release.mch 312,683,360 -35,932
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch 160,782,296 -21,116
realworld.run.osx.arm64.checked.mch 15,071,740 -16
FullOpts (-97,340 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.osx.arm64.checked.mch 11,180,388 +420
benchmarks.run_pgo.osx.arm64.checked.mch 18,099,980 -1,928
benchmarks.run_tiered.osx.arm64.checked.mch 4,045,284 -236
coreclr_tests.run.osx.arm64.checked.mch 153,165,920 -37,636
libraries.crossgen2.osx.arm64.checked.mch 55,619,208 +20
libraries.pmi.osx.arm64.checked.mch 79,834,184 -916
libraries_tests.run.osx.arm64.Release.mch 108,742,856 -35,932
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch 147,644,768 -21,116
realworld.run.osx.arm64.checked.mch 14,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)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch 10,964,120 +384
benchmarks.run_pgo.windows.arm64.checked.mch 47,218,960 -7,024
benchmarks.run_tiered.windows.arm64.checked.mch 15,346,624 -268
coreclr_tests.run.windows.arm64.checked.mch 495,323,188 -40,444
libraries.crossgen2.windows.arm64.checked.mch 58,963,476 +48
libraries.pmi.windows.arm64.checked.mch 79,565,936 -3,548
libraries_tests.run.windows.arm64.Release.mch 309,738,560 -44,932
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch 168,998,868 -21,232
realworld.run.windows.arm64.checked.mch 15,891,292 -192
smoke_tests.nativeaot.windows.arm64.checked.mch 3,972,452 -80
FullOpts (-117,288 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch 10,963,584 +384
benchmarks.run_pgo.windows.arm64.checked.mch 30,968,576 -7,024
benchmarks.run_tiered.windows.arm64.checked.mch 4,157,248 -268
coreclr_tests.run.windows.arm64.checked.mch 156,231,660 -40,444
libraries.crossgen2.windows.arm64.checked.mch 58,961,840 +48
libraries.pmi.windows.arm64.checked.mch 79,445,952 -3,548
libraries_tests.run.windows.arm64.Release.mch 108,157,056 -44,932
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch 155,861,404 -21,232
realworld.run.windows.arm64.checked.mch 15,322,868 -192
smoke_tests.nativeaot.windows.arm64.checked.mch 3,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)
Collection Base size (bytes) Diff size (bytes)
aspnet.run.windows.x64.checked.mch 41,763,246 -11,556
benchmarks.run.windows.x64.checked.mch 8,749,663 +2,072
benchmarks.run_pgo.windows.x64.checked.mch 34,741,684 -7,152
benchmarks.run_tiered.windows.x64.checked.mch 12,662,284 +203
coreclr_tests.run.windows.x64.checked.mch 392,866,349 -60,805
libraries.crossgen2.windows.x64.checked.mch 39,442,575 -1,101
libraries.pmi.windows.x64.checked.mch 61,196,926 -3,050
libraries_tests.run.windows.x64.Release.mch 279,034,285 -53,914
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch 133,435,993 -11,707
realworld.run.windows.x64.checked.mch 14,170,685 -3,315
smoke_tests.nativeaot.windows.x64.checked.mch 5,091,660 +111
FullOpts (-150,214 bytes)
Collection Base size (bytes) Diff size (bytes)
aspnet.run.windows.x64.checked.mch 27,104,521 -11,556
benchmarks.run.windows.x64.checked.mch 8,749,302 +2,072
benchmarks.run_pgo.windows.x64.checked.mch 20,506,707 -7,152
benchmarks.run_tiered.windows.x64.checked.mch 3,477,018 +203
coreclr_tests.run.windows.x64.checked.mch 119,323,357 -60,805
libraries.crossgen2.windows.x64.checked.mch 39,441,386 -1,101
libraries.pmi.windows.x64.checked.mch 61,083,407 -3,050
libraries_tests.run.windows.x64.Release.mch 100,665,969 -53,914
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch 123,012,623 -11,707
realworld.run.windows.x64.checked.mch 13,780,980 -3,315
smoke_tests.nativeaot.windows.x64.checked.mch 5,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)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm.checked.mch 15,304,692 +962
benchmarks.run_pgo.linux.arm.checked.mch 60,239,130 -2,152
benchmarks.run_tiered.linux.arm.checked.mch 22,645,104 +672
coreclr_tests.run.linux.arm.checked.mch 321,777,660 -18,494
libraries.crossgen2.linux.arm.checked.mch 35,174,904 -1,196
libraries.pmi.linux.arm.checked.mch 49,554,486 -2,374
libraries_tests.run.linux.arm.Release.mch 241,721,946 -37,822
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch 93,043,072 -12,090
realworld.run.linux.arm.checked.mch 13,613,084 -444
FullOpts (-72,938 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm.checked.mch 14,915,436 +962
benchmarks.run_pgo.linux.arm.checked.mch 49,441,528 -2,152
benchmarks.run_tiered.linux.arm.checked.mch 13,537,948 +672
coreclr_tests.run.linux.arm.checked.mch 109,047,526 -18,494
libraries.crossgen2.linux.arm.checked.mch 35,173,674 -1,196
libraries.pmi.linux.arm.checked.mch 49,447,982 -2,374
libraries_tests.run.linux.arm.Release.mch 119,719,002 -37,822
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch 82,959,252 -12,090
realworld.run.linux.arm.checked.mch 13,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)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.x86.checked.mch 7,079,626 +1,815
benchmarks.run_pgo.windows.x86.checked.mch 43,693,213 -14,646
benchmarks.run_tiered.windows.x86.checked.mch 9,483,002 +744
coreclr_tests.run.windows.x86.checked.mch 308,689,527 -81,235
libraries.crossgen2.windows.x86.checked.mch 31,589,655 -1,698
libraries.pmi.windows.x86.checked.mch 48,705,820 -7,539
libraries_tests.run.windows.x86.Release.mch 185,057,062 -59,640
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch 102,009,413 -13,900
realworld.run.windows.x86.checked.mch 11,326,284 -2,995
FullOpts (-179,094 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.x86.checked.mch 7,079,347 +1,815
benchmarks.run_pgo.windows.x86.checked.mch 37,063,723 -14,646
benchmarks.run_tiered.windows.x86.checked.mch 5,213,193 +744
coreclr_tests.run.windows.x86.checked.mch 107,017,758 -81,235
libraries.crossgen2.windows.x86.checked.mch 31,588,598 -1,698
libraries.pmi.windows.x86.checked.mch 48,610,506 -7,539
libraries_tests.run.windows.x86.Release.mch 86,725,555 -59,640
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch 93,339,621 -13,900
realworld.run.windows.x86.checked.mch 11,030,584 -2,995

Details here


Throughput diffs

Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.39% to -0.12%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
libraries.crossgen2.linux.arm64.checked.mch -0.01%
FullOpts (-0.48% to -0.13%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
benchmarks.run_pgo.osx.arm64.checked.mch -0.01%
libraries.crossgen2.osx.arm64.checked.mch -0.01%
FullOpts (-0.47% to -0.13%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
benchmarks.run_pgo.windows.arm64.checked.mch -0.01%
libraries.crossgen2.windows.arm64.checked.mch -0.01%
FullOpts (-0.49% to -0.13%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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
Member

Diff results for #97191

Throughput diffs

Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.34% to -0.10%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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

Diff results for #97191

Throughput diffs

Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.34% to -0.10%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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%)
Collection PDIFF
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
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
Member Author

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
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
Member Author

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
Member Author

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-actions github-actions bot locked and limited conversation to collaborators Feb 24, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants