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: Merge fgRemoveConditionalJump and fgOptimizeBranchToNext #97456

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

amanasifkhalid
Copy link
Member

Adding this back in after #97407. fgRemoveConditionalJump and fgOptimizeBranchToNext do the same thing, except that the latter explicitly assumes the false target of the BBJ_COND block being optimized is the next block. It makes sense to remove that assumption, and merge these methods before allowing the false target to diverge from the next block during flowgraph optimization phases.

@ghost ghost assigned amanasifkhalid Jan 24, 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 24, 2024
@ghost
Copy link

ghost commented Jan 24, 2024

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

Issue Details

Adding this back in after #97407. fgRemoveConditionalJump and fgOptimizeBranchToNext do the same thing, except that the latter explicitly assumes the false target of the BBJ_COND block being optimized is the next block. It makes sense to remove that assumption, and merge these methods before allowing the false target to diverge from the next block during flowgraph optimization phases.

Author: amanasifkhalid
Assignees: amanasifkhalid
Labels:

area-CodeGen-coreclr

Milestone: -

@amanasifkhalid
Copy link
Member Author

cc @dotnet/jit-contrib, @AndyAyersMS PTAL. Small improvements from slightly more aggressive statement removal.

@ryujit-bot
Copy link

Diff results for #97456

Assembly diffs

Assembly diffs for linux/arm64 ran on windows/x64

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

MISSED contexts: 4,060 (0.16%)

Overall (-60 bytes)
Collection Base size (bytes) Diff size (bytes)
libraries.pmi.linux.arm64.checked.mch 76,022,852 -36
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch 162,656,488 -24
FullOpts (-60 bytes)
Collection Base size (bytes) Diff size (bytes)
libraries.pmi.linux.arm64.checked.mch 75,902,868 -36
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch 149,175,276 -24

Assembly diffs for linux/x64 ran on windows/x64

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

MISSED contexts: 3,628 (0.14%)

Overall (-1,818 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.x64.checked.mch 13,735,124 -72
benchmarks.run_pgo.linux.x64.checked.mch 68,635,056 -19
benchmarks.run_tiered.linux.x64.checked.mch 17,373,152 -3
coreclr_tests.run.linux.x64.checked.mch 459,550,097 -47
libraries.crossgen2.linux.x64.checked.mch 38,670,232 -69
libraries.pmi.linux.x64.checked.mch 60,144,132 -481
libraries_tests.run.linux.x64.Release.mch 333,558,929 -711
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch 130,468,363 -344
realworld.run.linux.x64.checked.mch 13,194,603 -72
FullOpts (-1,818 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.x64.checked.mch 13,468,331 -72
benchmarks.run_pgo.linux.x64.checked.mch 48,805,299 -19
benchmarks.run_tiered.linux.x64.checked.mch 3,695,392 -3
coreclr_tests.run.linux.x64.checked.mch 132,991,962 -47
libraries.crossgen2.linux.x64.checked.mch 38,669,030 -69
libraries.pmi.linux.x64.checked.mch 60,031,262 -481
libraries_tests.run.linux.x64.Release.mch 149,169,408 -711
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch 119,809,892 -344
realworld.run.linux.x64.checked.mch 12,805,497 -72

Assembly diffs for osx/arm64 ran on windows/x64

Diffs are based on 2,262,709 contexts (930,876 MinOpts, 1,331,833 FullOpts).

MISSED contexts: 3,256 (0.14%)

Overall (-60 bytes)
Collection Base size (bytes) Diff size (bytes)
libraries.pmi.osx.arm64.checked.mch 79,955,476 -36
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch 160,911,076 -24
FullOpts (-60 bytes)
Collection Base size (bytes) Diff size (bytes)
libraries.pmi.osx.arm64.checked.mch 79,834,348 -36
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch 147,773,548 -24

Assembly diffs for windows/arm64 ran on windows/x64

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

MISSED contexts: 2,687 (0.12%)

Overall (-100 bytes)
Collection Base size (bytes) Diff size (bytes)
coreclr_tests.run.windows.arm64.checked.mch 495,372,096 -24
libraries.pmi.windows.arm64.checked.mch 79,594,724 -36
libraries_tests.run.windows.arm64.Release.mch 310,511,308 -16
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch 169,134,348 -24
FullOpts (-100 bytes)
Collection Base size (bytes) Diff size (bytes)
coreclr_tests.run.windows.arm64.checked.mch 156,280,568 -24
libraries.pmi.windows.arm64.checked.mch 79,474,740 -36
libraries_tests.run.windows.arm64.Release.mch 108,929,804 -16
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch 155,996,884 -24

Assembly diffs for windows/x64 ran on windows/x64

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

MISSED contexts: 3,899 (0.16%)

Overall (-1,531 bytes)
Collection Base size (bytes) Diff size (bytes)
aspnet.run.windows.x64.checked.mch 42,178,256 -74
benchmarks.run.windows.x64.checked.mch 8,747,570 -67
coreclr_tests.run.windows.x64.checked.mch 393,404,923 -120
libraries.crossgen2.windows.x64.checked.mch 39,443,922 -70
libraries.pmi.windows.x64.checked.mch 61,389,190 -447
libraries_tests.run.windows.x64.Release.mch 281,642,309 -383
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch 133,913,806 -296
realworld.run.windows.x64.checked.mch 14,170,687 -74
FullOpts (-1,531 bytes)
Collection Base size (bytes) Diff size (bytes)
aspnet.run.windows.x64.checked.mch 27,519,531 -74
benchmarks.run.windows.x64.checked.mch 8,747,209 -67
coreclr_tests.run.windows.x64.checked.mch 119,861,931 -120
libraries.crossgen2.windows.x64.checked.mch 39,442,733 -70
libraries.pmi.windows.x64.checked.mch 61,275,671 -447
libraries_tests.run.windows.x64.Release.mch 103,273,993 -383
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch 123,490,436 -296
realworld.run.windows.x64.checked.mch 13,780,982 -74

Details here


Assembly diffs for linux/arm ran on windows/x86

Diffs are based on 2,237,690 contexts (827,812 MinOpts, 1,409,878 FullOpts).

MISSED contexts: 74,588 (3.23%)

Overall (-1,314 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm.checked.mch 15,303,134 -66
benchmarks.run_pgo.linux.arm.checked.mch 61,262,128 -138
benchmarks.run_tiered.linux.arm.checked.mch 22,643,448 -56
coreclr_tests.run.linux.arm.checked.mch 321,791,116 -70
libraries.crossgen2.linux.arm.checked.mch 35,175,262 -70
libraries.pmi.linux.arm.checked.mch 49,615,946 -290
libraries_tests.run.linux.arm.Release.mch 242,762,120 -400
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch 93,201,612 -174
realworld.run.linux.arm.checked.mch 13,613,446 -50
FullOpts (-1,314 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm.checked.mch 14,913,878 -66
benchmarks.run_pgo.linux.arm.checked.mch 50,464,526 -138
benchmarks.run_tiered.linux.arm.checked.mch 13,536,292 -56
coreclr_tests.run.linux.arm.checked.mch 109,060,982 -70
libraries.crossgen2.linux.arm.checked.mch 35,174,032 -70
libraries.pmi.linux.arm.checked.mch 49,509,442 -290
libraries_tests.run.linux.arm.Release.mch 120,759,176 -400
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch 83,117,792 -174
realworld.run.linux.arm.checked.mch 13,163,500 -50

Assembly diffs for windows/x86 ran on windows/x86

Diffs are based on 2,296,277 contexts (841,817 MinOpts, 1,454,460 FullOpts).

MISSED contexts: 5,093 (0.22%)

Overall (-1,067 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.x86.checked.mch 7,107,453 -50
benchmarks.run_pgo.windows.x86.checked.mch 45,222,512 -30
benchmarks.run_tiered.windows.x86.checked.mch 9,511,426 -40
coreclr_tests.run.windows.x86.checked.mch 309,180,492 -70
libraries.crossgen2.windows.x86.checked.mch 31,628,298 -84
libraries.pmi.windows.x86.checked.mch 48,827,886 -314
libraries_tests.run.windows.x86.Release.mch 185,843,933 -224
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch 102,198,175 -200
realworld.run.windows.x86.checked.mch 11,363,356 -55
FullOpts (-1,067 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.x86.checked.mch 7,107,174 -50
benchmarks.run_pgo.windows.x86.checked.mch 38,593,022 -30
benchmarks.run_tiered.windows.x86.checked.mch 5,241,617 -40
coreclr_tests.run.windows.x86.checked.mch 107,508,723 -70
libraries.crossgen2.windows.x86.checked.mch 31,627,241 -84
libraries.pmi.windows.x86.checked.mch 48,732,572 -314
libraries_tests.run.windows.x86.Release.mch 87,512,426 -224
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch 93,528,383 -200
realworld.run.windows.x86.checked.mch 11,067,656 -55

Details here


Throughput diffs

Throughput diffs for linux/arm ran on windows/x86

Overall (-0.01% to -0.00%)
Collection PDIFF
benchmarks.run_pgo.linux.arm.checked.mch -0.01%
libraries_tests.run.linux.arm.Release.mch -0.01%
FullOpts (-0.01% to -0.00%)
Collection PDIFF
benchmarks.run_pgo.linux.arm.checked.mch -0.01%
libraries_tests.run.linux.arm.Release.mch -0.01%

Details here


@amanasifkhalid
Copy link
Member Author

cc @dotnet/jit-contrib, bumping this since the diffs in #97488 are skewed without it.

@amanasifkhalid
Copy link
Member Author

Thank you!

@amanasifkhalid amanasifkhalid merged commit 4644486 into dotnet:main Jan 26, 2024
129 checks passed
@amanasifkhalid amanasifkhalid deleted the fgRemoveConditionalJump branch January 26, 2024 20:44
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 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.

3 participants