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

Use the LLVM option NoTrapAfterNoreturn #110494

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

majaha
Copy link
Contributor

@majaha majaha commented Apr 18, 2023

Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations.

See further discussion here: rust-lang/compiler-team#618

@rustbot
Copy link
Collaborator

rustbot commented Apr 18, 2023

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 18, 2023
@majaha
Copy link
Contributor Author

majaha commented Apr 18, 2023

r? @nikic

@rustbot rustbot assigned nikic and unassigned cuviper Apr 18, 2023
@cuviper
Copy link
Member

cuviper commented Apr 18, 2023

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 18, 2023
@bors
Copy link
Contributor

bors commented Apr 18, 2023

⌛ Trying commit 6fa99de with merge dfdcb90ce055efdcb7fbbc19971eed7bb3ba284c...

@bors
Copy link
Contributor

bors commented Apr 18, 2023

☀️ Try build successful - checks-actions
Build commit: dfdcb90ce055efdcb7fbbc19971eed7bb3ba284c (dfdcb90ce055efdcb7fbbc19971eed7bb3ba284c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dfdcb90ce055efdcb7fbbc19971eed7bb3ba284c): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
-1.7% [-1.9%, -1.6%] 2
Improvements ✅
(secondary)
-0.8% [-0.9%, -0.7%] 2
All ❌✅ (primary) -1.7% [-1.9%, -1.6%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.6% [-9.6%, -3.5%] 3
All ❌✅ (primary) - - 0

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 18, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Apr 18, 2023

Shaved off 4 KiB from the "minimal size" Rust hello world binary (https://perf.rust-lang.org/compare.html?start=de96f3d8735b70d5dc1ca178aaee198b329b8f3d&end=dfdcb90ce055efdcb7fbbc19971eed7bb3ba284c&stat=size%3Alinked_artifact&showRawData=true). Not bad :)

@majaha
Copy link
Contributor Author

majaha commented Apr 18, 2023

That's actually more than I expected. I wonder where it's all going?

I suppose it must be unblocking some other optimisation pass.

@majaha
Copy link
Contributor Author

majaha commented May 3, 2023

The MCP for this Pull request has been accepted, so it should be okay to merge now.

@nikic
Copy link
Contributor

nikic commented May 3, 2023

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented May 3, 2023

📌 Commit 6fa99de has been approved by nikic

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2023
@bors
Copy link
Contributor

bors commented May 4, 2023

⌛ Testing commit 6fa99de with merge 524076fadf02b06596a6e1ddd0deea5a679f2e58...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 4, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 4, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2023
Use the LLVM option NoTrapAfterNoreturn

Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations.

See further discussion here: rust-lang/compiler-team#618
@majaha
Copy link
Contributor Author

majaha commented Nov 8, 2023

Is bors okay? This PR seems to be the only one marked S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. that is older than a few hours.
It's there in the queue, marked "success" in blue (I'm not quite sure what that means). Could it be because "@bors try" was run on this a while ago, or because it was given "rollup=never"? Or maybe because I pressed GitHub's "request review" button and it's still technically pending?
image

@cuviper
Copy link
Member

cuviper commented Nov 8, 2023

@bors retry

@cuviper
Copy link
Member

cuviper commented Nov 8, 2023

I guess it glitched, but it's back in the approved queue at the top now.

@bors
Copy link
Contributor

bors commented Nov 8, 2023

⌛ Testing commit 4a8c5cb with merge c935604...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2023
Use the LLVM option NoTrapAfterNoreturn

Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations.

See further discussion here: rust-lang/compiler-team#618
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-mingw failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [rustdoc] tests\rustdoc\inline_cross\issue-31948-1.rs stdout ----

error: rustdoc failed!
status: exit code: 0xc00000fd
command: PATH="C:\a\rust\rust\build\x86_64-pc-windows-gnu\stage2\bin;C:\a\rust\rust\build\x86_64-pc-windows-gnu\stage0-bootstrap-tools\x86_64-pc-windows-gnu\release\deps;C:\a\rust\rust\build\x86_64-pc-windows-gnu\stage0\bin;C:\a\rust\rust\ninja;C:\a\rust\rust\mingw64\bin;C:\hostedtoolcache\windows\Python\3.12.0\x64\Scripts;C:\hostedtoolcache\windows\Python\3.12.0\x64;C:\msys64\usr\bin;C:\a\rust\rust\sccache;C:\PROGRA~1\MongoDB\bin;C:\aliyun-cli;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\2.13.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\R\R-4.3.1\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.10\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.392-8\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Microsoft BizTalk Server;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustdoc.exe" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\rustdoc\\inline_cross\\issue-31948-1\\auxiliary\\rustdoc-nonreachable-impls\\auxiliary" "-o" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\rustdoc\\inline_cross\\issue-31948-1" "--deny" "warnings" "C:\\a\\rust\\rust\\tests\\rustdoc\\inline_cross\\auxiliary\\rustdoc-nonreachable-impls.rs" "-A" "internal_features"
--- stderr -------------------------------

thread 'main' has overflowed its stack
------------------------------------------

@bors
Copy link
Contributor

bors commented Nov 8, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 8, 2023
TaKO8Ki added a commit to TaKO8Ki/rust that referenced this pull request Nov 9, 2023
Use the LLVM option NoTrapAfterNoreturn

Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations.

See further discussion here: rust-lang/compiler-team#618
@majaha
Copy link
Contributor Author

majaha commented Nov 9, 2023

Hmm, a stack overflow in rustdoc on mingw. That's unfortunate. I'm downloading mingw now, does anyone have any insight into why that might have happened?

@bors
Copy link
Contributor

bors commented Dec 8, 2023

⌛ Testing commit 4a8c5cb with merge 5df0ed7...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2023
Use the LLVM option NoTrapAfterNoreturn

Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations.

See further discussion here: rust-lang/compiler-team#618
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Dec 8, 2023

💔 Test failed - checks-actions

@Noratrieb
Copy link
Member

maybe the stackoverflow was spurious.. let's just try this again and see what happens
@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 16, 2023
@Noratrieb
Copy link
Member

by the way, for debugging local failures, you don't have to install anything except docker, you can use ./src/ci/docker/run.sh BUILDER_NAME to build it locally. I'm not sure whether those scripts work on not-Linux, but on Linux they work.

@bors
Copy link
Contributor

bors commented Dec 16, 2023

⌛ Testing commit 4a8c5cb with merge 02ad667...

@bors
Copy link
Contributor

bors commented Dec 16, 2023

☀️ Test successful - checks-actions
Approved by: nikic
Pushing 02ad667 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 16, 2023
@bors bors merged commit 02ad667 into rust-lang:master Dec 16, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 16, 2023
@Noratrieb
Copy link
Member

ha, fun. I found this PR while scrolling through old PRs. Next time, feel free to ask on https://rust-lang.zulipchat.com/ if you're facing issues and don't get a response on the PR.

@majaha
Copy link
Contributor Author

majaha commented Dec 16, 2023

Well that saves me some time! I was still planning to come back to this eventually. Thanks!

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (02ad667): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.9% [-0.9%, -0.8%] 4
Improvements ✅
(secondary)
-0.5% [-0.8%, -0.3%] 25
All ❌✅ (primary) -0.9% [-0.9%, -0.8%] 4

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
2.5% [2.0%, 3.0%] 2
Improvements ✅
(primary)
-2.1% [-3.5%, -0.6%] 3
Improvements ✅
(secondary)
-2.1% [-3.2%, -1.0%] 2
All ❌✅ (primary) -1.2% [-3.5%, 1.4%] 4

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.8%, -1.9%] 5
All ❌✅ (primary) - - 0

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 36
Improvements ✅
(secondary)
-0.2% [-1.3%, -0.0%] 8
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 36

Bootstrap: 672.461s -> 672.679s (0.03%)
Artifact size: 312.46 MiB -> 312.39 MiB (-0.02%)

@majaha majaha deleted the noTrapAfterNoreturn branch April 8, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.