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: Generalize jump threading very slightly #98107

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Feb 7, 2024

If the dominator is a direct predecessor then it should be ok to jump thread its direct edge, even if the other edge also reaches. I think.

(Noticed this while looking at the case in #98096 (comment), where we considered BB33 to be an ambiguous pred of BB38, but it seems we should be able to consider it to be a "true" pred.)

If the dominator is a direct predecessor then it should be ok to jump
thread its direct edge, even if the other edge also reaches.
@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 Feb 7, 2024
@ghost ghost assigned jakobbotsch Feb 7, 2024
@ghost
Copy link

ghost commented Feb 7, 2024

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

Issue Details

If the dominator is a direct predecessor then it should be ok to jump thread its direct edge, even if the other edge also reaches. I think.

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone: -

@ryujit-bot
Copy link

Diff results for #98107

Assembly diffs

Assembly diffs for linux/x64 ran on windows/x64

Diffs are based on 1,621,200 contexts (360,162 MinOpts, 1,261,038 FullOpts).

MISSED contexts: base: 2,647 (0.16%), diff: 2,650 (0.16%)

Overall (-742 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.x64.checked.mch 11,931,736 +97
benchmarks.run_pgo.linux.x64.checked.mch 57,208,438 +1,769
benchmarks.run_tiered.linux.x64.checked.mch 18,554,476 -48
coreclr_tests.run.linux.x64.checked.mch 247,130,491 -254
libraries.crossgen2.linux.x64.checked.mch 44,619,341 -85
libraries.pmi.linux.x64.checked.mch 60,391,350 -848
libraries_tests.run.linux.x64.Release.mch 31,730,283 -231
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch 130,012,769 -961
realworld.run.linux.x64.checked.mch 13,219,489 -24
smoke_tests.nativeaot.linux.x64.checked.mch 4,228,743 -157
FullOpts (-742 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.x64.checked.mch 11,762,034 +97
benchmarks.run_pgo.linux.x64.checked.mch 39,461,926 +1,769
benchmarks.run_tiered.linux.x64.checked.mch 3,498,730 -48
coreclr_tests.run.linux.x64.checked.mch 106,763,610 -254
libraries.crossgen2.linux.x64.checked.mch 44,618,143 -85
libraries.pmi.linux.x64.checked.mch 60,278,493 -848
libraries_tests.run.linux.x64.Release.mch 15,802,466 -231
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch 119,428,914 -961
realworld.run.linux.x64.checked.mch 12,830,953 -24
smoke_tests.nativeaot.linux.x64.checked.mch 4,227,794 -157

Assembly diffs for osx/arm64 ran on windows/x64

Diffs are based on 1,733,615 contexts (561,303 MinOpts, 1,172,312 FullOpts).

MISSED contexts: base: 2,902 (0.17%), diff: 2,906 (0.17%)

Overall (-6,596 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.osx.arm64.checked.mch 11,101,028 -140
benchmarks.run_pgo.osx.arm64.checked.mch 24,782,000 -120
benchmarks.run_tiered.osx.arm64.checked.mch 15,471,752 -76
coreclr_tests.run.osx.arm64.checked.mch 390,213,652 -800
libraries.crossgen2.osx.arm64.checked.mch 63,645,568 -216
libraries.pmi.osx.arm64.checked.mch 80,235,780 -2,060
libraries_tests.run.osx.arm64.Release.mch 72,839,284 -472
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch 159,909,600 -2,464
realworld.run.osx.arm64.checked.mch 15,078,748 -248
FullOpts (-6,596 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.osx.arm64.checked.mch 11,100,292 -140
benchmarks.run_pgo.osx.arm64.checked.mch 8,787,588 -120
benchmarks.run_tiered.osx.arm64.checked.mch 3,950,116 -76
coreclr_tests.run.osx.arm64.checked.mch 138,802,076 -800
libraries.crossgen2.osx.arm64.checked.mch 63,643,940 -216
libraries.pmi.osx.arm64.checked.mch 80,114,652 -2,060
libraries_tests.run.osx.arm64.Release.mch 12,454,304 -472
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch 146,850,240 -2,464
realworld.run.osx.arm64.checked.mch 14,514,796 -248

Assembly diffs for windows/x64 ran on windows/x64

Diffs are based on 1,999,660 contexts (587,594 MinOpts, 1,412,066 FullOpts).

MISSED contexts: base: 3,225 (0.16%), diff: 3,228 (0.16%)

Overall (-4,484 bytes)
Collection Base size (bytes) Diff size (bytes)
aspnet.run.windows.x64.checked.mch 46,770,084 -2,631
benchmarks.run.windows.x64.checked.mch 11,727,476 +35
benchmarks.run_pgo.windows.x64.checked.mch 34,353,258 +748
benchmarks.run_tiered.windows.x64.checked.mch 19,449,443 -135
coreclr_tests.run.windows.x64.checked.mch 296,149,050 -317
libraries.crossgen2.windows.x64.checked.mch 44,929,099 -115
libraries.pmi.windows.x64.checked.mch 67,667,009 -850
libraries_tests.run.windows.x64.Release.mch 42,430,255 -25
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch 142,641,215 -871
realworld.run.windows.x64.checked.mch 14,769,832 -233
smoke_tests.nativeaot.windows.x64.checked.mch 5,085,273 -90
FullOpts (-4,484 bytes)
Collection Base size (bytes) Diff size (bytes)
aspnet.run.windows.x64.checked.mch 28,281,344 -2,631
benchmarks.run.windows.x64.checked.mch 11,726,881 +35
benchmarks.run_pgo.windows.x64.checked.mch 15,516,562 +748
benchmarks.run_tiered.windows.x64.checked.mch 4,081,554 -135
coreclr_tests.run.windows.x64.checked.mch 110,374,660 -317
libraries.crossgen2.windows.x64.checked.mch 44,927,912 -115
libraries.pmi.windows.x64.checked.mch 67,553,488 -850
libraries_tests.run.windows.x64.Release.mch 10,788,375 -25
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch 131,858,345 -871
realworld.run.windows.x64.checked.mch 14,383,223 -233
smoke_tests.nativeaot.windows.x64.checked.mch 5,084,326 -90

Details here


Assembly diffs for linux/arm ran on windows/x86

Diffs are based on 1,449,677 contexts (345,734 MinOpts, 1,103,943 FullOpts).

MISSED contexts: 55,309 (3.68%)

Overall (-2,852 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm.checked.mch 13,691,660 -68
benchmarks.run_pgo.linux.arm.checked.mch 24,676,764 -26
benchmarks.run_tiered.linux.arm.checked.mch 17,983,552 -64
coreclr_tests.run.linux.arm.checked.mch 321,243,680 -498
libraries.crossgen2.linux.arm.checked.mch 35,989,292 -28
libraries.pmi.linux.arm.checked.mch 49,882,798 -1,070
libraries_tests.run.linux.arm.Release.mch 17,138,332 -84
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch 93,857,406 -886
realworld.run.linux.arm.checked.mch 13,598,268 -128
FullOpts (-2,852 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.linux.arm.checked.mch 13,379,084 -68
benchmarks.run_pgo.linux.arm.checked.mch 19,755,612 -26
benchmarks.run_tiered.linux.arm.checked.mch 10,616,262 -64
coreclr_tests.run.linux.arm.checked.mch 108,808,730 -498
libraries.crossgen2.linux.arm.checked.mch 35,988,062 -28
libraries.pmi.linux.arm.checked.mch 49,776,574 -1,070
libraries_tests.run.linux.arm.Release.mch 16,541,272 -84
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch 83,827,636 -886
realworld.run.linux.arm.checked.mch 13,163,196 -128

Assembly diffs for windows/x86 ran on windows/x86

Diffs are based on 1,625,054 contexts (327,626 MinOpts, 1,297,428 FullOpts).

MISSED contexts: base: 4,647 (0.29%), diff: 4,685 (0.29%)

Overall (-2,380 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.x86.checked.mch 11,308,587 -228
benchmarks.run_pgo.windows.x86.checked.mch 33,240,977 -110
benchmarks.run_tiered.windows.x86.checked.mch 14,131,622 -220
coreclr_tests.run.windows.x86.checked.mch 215,366,523 +206
libraries.crossgen2.windows.x86.checked.mch 36,012,344 -91
libraries.pmi.windows.x86.checked.mch 51,340,369 -1,121
libraries_tests.run.windows.x86.Release.mch 14,894,587 -72
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch 109,493,031 -679
realworld.run.windows.x86.checked.mch 11,827,284 -65
FullOpts (-2,380 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.x86.checked.mch 11,308,109 -228
benchmarks.run_pgo.windows.x86.checked.mch 27,119,029 -110
benchmarks.run_tiered.windows.x86.checked.mch 7,276,985 -220
coreclr_tests.run.windows.x86.checked.mch 93,105,499 +206
libraries.crossgen2.windows.x86.checked.mch 36,011,284 -91
libraries.pmi.windows.x86.checked.mch 51,245,136 -1,121
libraries_tests.run.windows.x86.Release.mch 9,404,392 -72
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch 100,540,258 -679
realworld.run.windows.x86.checked.mch 11,531,570 -65

Details here


Throughput diffs

Throughput diffs for linux/arm64 ran on windows/x64

Overall (-0.04% to -0.00%)
Collection PDIFF
benchmarks.run.linux.arm64.checked.mch -0.02%
benchmarks.run_pgo.linux.arm64.checked.mch -0.04%
benchmarks.run_tiered.linux.arm64.checked.mch -0.01%
libraries.pmi.linux.arm64.checked.mch -0.02%
libraries_tests.run.linux.arm64.Release.mch -0.01%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch -0.02%
realworld.run.linux.arm64.checked.mch -0.02%
smoke_tests.nativeaot.linux.arm64.checked.mch -0.01%
FullOpts (-0.05% to -0.00%)
Collection PDIFF
benchmarks.run.linux.arm64.checked.mch -0.02%
benchmarks.run_pgo.linux.arm64.checked.mch -0.05%
benchmarks.run_tiered.linux.arm64.checked.mch -0.02%
libraries.pmi.linux.arm64.checked.mch -0.02%
libraries_tests.run.linux.arm64.Release.mch -0.02%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch -0.02%
realworld.run.linux.arm64.checked.mch -0.02%
smoke_tests.nativeaot.linux.arm64.checked.mch -0.01%

Throughput diffs for linux/x64 ran on windows/x64

Overall (-0.06% to -0.00%)
Collection PDIFF
benchmarks.run.linux.x64.checked.mch -0.02%
benchmarks.run_pgo.linux.x64.checked.mch -0.04%
benchmarks.run_tiered.linux.x64.checked.mch -0.01%
libraries.pmi.linux.x64.checked.mch -0.02%
libraries_tests.run.linux.x64.Release.mch -0.06%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch -0.02%
realworld.run.linux.x64.checked.mch -0.02%
smoke_tests.nativeaot.linux.x64.checked.mch -0.01%
FullOpts (-0.07% to -0.00%)
Collection PDIFF
benchmarks.run.linux.x64.checked.mch -0.02%
benchmarks.run_pgo.linux.x64.checked.mch -0.04%
benchmarks.run_tiered.linux.x64.checked.mch -0.02%
libraries.pmi.linux.x64.checked.mch -0.02%
libraries_tests.run.linux.x64.Release.mch -0.07%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch -0.02%
realworld.run.linux.x64.checked.mch -0.02%
smoke_tests.nativeaot.linux.x64.checked.mch -0.01%

Throughput diffs for osx/arm64 ran on windows/x64

Overall (-0.02% to -0.00%)
Collection PDIFF
benchmarks.run.osx.arm64.checked.mch -0.02%
benchmarks.run_pgo.osx.arm64.checked.mch -0.02%
benchmarks.run_tiered.osx.arm64.checked.mch -0.01%
libraries.pmi.osx.arm64.checked.mch -0.01%
libraries_tests.run.osx.arm64.Release.mch -0.02%
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch -0.02%
realworld.run.osx.arm64.checked.mch -0.02%
FullOpts (-0.04% to -0.00%)
Collection PDIFF
benchmarks.run.osx.arm64.checked.mch -0.02%
benchmarks.run_pgo.osx.arm64.checked.mch -0.03%
benchmarks.run_tiered.osx.arm64.checked.mch -0.01%
libraries.pmi.osx.arm64.checked.mch -0.01%
libraries_tests.run.osx.arm64.Release.mch -0.04%
libraries_tests_no_tiered_compilation.run.osx.arm64.Release.mch -0.02%
realworld.run.osx.arm64.checked.mch -0.02%

Throughput diffs for windows/arm64 ran on windows/x64

Overall (-0.05% to -0.00%)
Collection PDIFF
benchmarks.run.windows.arm64.checked.mch -0.02%
benchmarks.run_pgo.windows.arm64.checked.mch -0.05%
benchmarks.run_tiered.windows.arm64.checked.mch -0.01%
libraries.pmi.windows.arm64.checked.mch -0.02%
libraries_tests.run.windows.arm64.Release.mch -0.03%
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch -0.02%
realworld.run.windows.arm64.checked.mch -0.02%
smoke_tests.nativeaot.windows.arm64.checked.mch -0.02%
MinOpts (-0.00% to +0.01%)
Collection PDIFF
libraries.pmi.windows.arm64.checked.mch +0.01%
FullOpts (-0.06% to -0.00%)
Collection PDIFF
benchmarks.run.windows.arm64.checked.mch -0.02%
benchmarks.run_pgo.windows.arm64.checked.mch -0.06%
benchmarks.run_tiered.windows.arm64.checked.mch -0.01%
libraries.pmi.windows.arm64.checked.mch -0.02%
libraries_tests.run.windows.arm64.Release.mch -0.03%
libraries_tests_no_tiered_compilation.run.windows.arm64.Release.mch -0.02%
realworld.run.windows.arm64.checked.mch -0.02%
smoke_tests.nativeaot.windows.arm64.checked.mch -0.02%

Throughput diffs for windows/x64 ran on windows/x64

Overall (-0.03% to -0.00%)
Collection PDIFF
aspnet.run.windows.x64.checked.mch -0.02%
benchmarks.run.windows.x64.checked.mch -0.02%
benchmarks.run_pgo.windows.x64.checked.mch -0.02%
benchmarks.run_tiered.windows.x64.checked.mch -0.01%
libraries.pmi.windows.x64.checked.mch -0.02%
libraries_tests.run.windows.x64.Release.mch -0.02%
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch -0.03%
realworld.run.windows.x64.checked.mch -0.02%
smoke_tests.nativeaot.windows.x64.checked.mch -0.02%
FullOpts (-0.03% to -0.00%)
Collection PDIFF
aspnet.run.windows.x64.checked.mch -0.03%
benchmarks.run.windows.x64.checked.mch -0.02%
benchmarks.run_pgo.windows.x64.checked.mch -0.03%
benchmarks.run_tiered.windows.x64.checked.mch -0.02%
coreclr_tests.run.windows.x64.checked.mch -0.01%
libraries.pmi.windows.x64.checked.mch -0.02%
libraries_tests.run.windows.x64.Release.mch -0.03%
libraries_tests_no_tiered_compilation.run.windows.x64.Release.mch -0.03%
realworld.run.windows.x64.checked.mch -0.02%
smoke_tests.nativeaot.windows.x64.checked.mch -0.02%

Details here


Throughput diffs for linux/arm ran on windows/x86

Overall (-0.04% to -0.00%)
Collection PDIFF
benchmarks.run.linux.arm.checked.mch -0.01%
benchmarks.run_pgo.linux.arm.checked.mch -0.01%
benchmarks.run_tiered.linux.arm.checked.mch -0.01%
libraries.pmi.linux.arm.checked.mch -0.02%
libraries_tests.run.linux.arm.Release.mch -0.04%
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch -0.02%
realworld.run.linux.arm.checked.mch -0.01%
FullOpts (-0.04% to -0.00%)
Collection PDIFF
benchmarks.run.linux.arm.checked.mch -0.01%
benchmarks.run_pgo.linux.arm.checked.mch -0.01%
benchmarks.run_tiered.linux.arm.checked.mch -0.01%
coreclr_tests.run.linux.arm.checked.mch -0.01%
libraries.pmi.linux.arm.checked.mch -0.02%
libraries_tests.run.linux.arm.Release.mch -0.04%
libraries_tests_no_tiered_compilation.run.linux.arm.Release.mch -0.02%
realworld.run.linux.arm.checked.mch -0.01%

Throughput diffs for windows/x86 ran on windows/x86

Overall (-0.05% to -0.00%)
Collection PDIFF
benchmarks.run.windows.x86.checked.mch -0.02%
benchmarks.run_pgo.windows.x86.checked.mch -0.05%
benchmarks.run_tiered.windows.x86.checked.mch -0.02%
libraries.pmi.windows.x86.checked.mch -0.02%
libraries_tests.run.windows.x86.Release.mch -0.02%
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch -0.03%
realworld.run.windows.x86.checked.mch -0.02%
FullOpts (-0.06% to -0.00%)
Collection PDIFF
benchmarks.run.windows.x86.checked.mch -0.02%
benchmarks.run_pgo.windows.x86.checked.mch -0.06%
benchmarks.run_tiered.windows.x86.checked.mch -0.02%
coreclr_tests.run.windows.x86.checked.mch -0.01%
libraries.pmi.windows.x86.checked.mch -0.02%
libraries_tests.run.windows.x86.Release.mch -0.03%
libraries_tests_no_tiered_compilation.run.windows.x86.Release.mch -0.03%
realworld.run.windows.x86.checked.mch -0.02%

Details here


Throughput diffs for linux/arm64 ran on linux/x64

Overall (-0.03% to -0.00%)
Collection PDIFF
benchmarks.run.linux.arm64.checked.mch -0.01%
realworld.run.linux.arm64.checked.mch -0.01%
benchmarks.run_tiered.linux.arm64.checked.mch -0.01%
benchmarks.run_pgo.linux.arm64.checked.mch -0.03%
libraries.pmi.linux.arm64.checked.mch -0.01%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch -0.02%
libraries_tests.run.linux.arm64.Release.mch -0.01%
smoke_tests.nativeaot.linux.arm64.checked.mch -0.01%
FullOpts (-0.03% to -0.00%)
Collection PDIFF
benchmarks.run.linux.arm64.checked.mch -0.01%
realworld.run.linux.arm64.checked.mch -0.01%
benchmarks.run_tiered.linux.arm64.checked.mch -0.01%
benchmarks.run_pgo.linux.arm64.checked.mch -0.03%
libraries.pmi.linux.arm64.checked.mch -0.01%
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch -0.02%
libraries_tests.run.linux.arm64.Release.mch -0.02%
smoke_tests.nativeaot.linux.arm64.checked.mch -0.01%

Throughput diffs for linux/x64 ran on linux/x64

Overall (-0.05% to -0.00%)
Collection PDIFF
benchmarks.run.linux.x64.checked.mch -0.01%
benchmarks.run_pgo.linux.x64.checked.mch -0.02%
libraries.pmi.linux.x64.checked.mch -0.01%
realworld.run.linux.x64.checked.mch -0.01%
libraries_tests.run.linux.x64.Release.mch -0.05%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch -0.02%
smoke_tests.nativeaot.linux.x64.checked.mch -0.01%
benchmarks.run_tiered.linux.x64.checked.mch -0.01%
FullOpts (-0.06% to -0.00%)
Collection PDIFF
benchmarks.run.linux.x64.checked.mch -0.01%
benchmarks.run_pgo.linux.x64.checked.mch -0.03%
libraries.pmi.linux.x64.checked.mch -0.01%
realworld.run.linux.x64.checked.mch -0.01%
libraries_tests.run.linux.x64.Release.mch -0.06%
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch -0.02%
smoke_tests.nativeaot.linux.x64.checked.mch -0.01%
benchmarks.run_tiered.linux.x64.checked.mch -0.01%

Details here


@jakobbotsch
Copy link
Member Author

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

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jakobbotsch jakobbotsch marked this pull request as ready for review February 7, 2024 20:03
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS. Should be ready, pending CI. Just something minor I noticed while looking at the other example.

Diffs are somewhat mixed, though a lot of the benchmarks.run_pgo regressions look to be a repeated one in the same function.

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Thanks for spotting this!

@jakobbotsch
Copy link
Member Author

Failures look to be known.

@jakobbotsch jakobbotsch merged commit a78ddcc into dotnet:main Feb 8, 2024
184 of 195 checks passed
@jakobbotsch jakobbotsch deleted the generalize-rbo branch February 8, 2024 09:37
@cincuranet
Copy link
Contributor

@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 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