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

Update to LLVM 20 #135763

Merged
merged 3 commits into from
Feb 17, 2025
Merged

Update to LLVM 20 #135763

merged 3 commits into from
Feb 17, 2025

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jan 20, 2025

@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 Jan 20, 2025
@nikic
Copy link
Contributor Author

nikic commented Jan 20, 2025

@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 Jan 20, 2025
@bors
Copy link
Contributor

bors commented Jan 20, 2025

⌛ Trying commit fc35e8c with merge 79efb5f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2025
@bors
Copy link
Contributor

bors commented Jan 20, 2025

☀️ Try build successful - checks-actions
Build commit: 79efb5f (79efb5ff182537ce584a422f953ff24ab8f741db)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (79efb5f): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
5.2% [0.3%, 34.9%] 8
Regressions ❌
(secondary)
0.6% [0.3%, 1.1%] 14
Improvements ✅
(primary)
-1.3% [-4.2%, -0.2%] 250
Improvements ✅
(secondary)
-1.0% [-5.0%, -0.2%] 192
All ❌✅ (primary) -1.1% [-4.2%, 34.9%] 258

Max RSS (memory usage)

Results (primary -1.5%, secondary -1.3%)

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.1% [1.1%, 1.2%] 2
Regressions ❌
(secondary)
2.1% [1.1%, 3.6%] 3
Improvements ✅
(primary)
-1.9% [-3.8%, -1.0%] 11
Improvements ✅
(secondary)
-2.1% [-3.4%, -0.9%] 13
All ❌✅ (primary) -1.5% [-3.8%, 1.2%] 13

Cycles

Results (primary -1.8%, secondary -5.0%)

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)
39.1% [39.1%, 39.1%] 1
Regressions ❌
(secondary)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
-2.4% [-4.2%, -1.1%] 73
Improvements ✅
(secondary)
-5.2% [-13.6%, -0.9%] 36
All ❌✅ (primary) -1.8% [-4.2%, 39.1%] 74

Binary size

Results (primary -1.2%, secondary -3.0%)

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.2% [0.1%, 0.5%] 12
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-7.1%, -0.0%] 96
Improvements ✅
(secondary)
-3.0% [-7.2%, -0.1%] 90
All ❌✅ (primary) -1.2% [-7.1%, 0.5%] 108

Bootstrap: 765.63s -> 749.726s (-2.08%)
Artifact size: 326.02 MiB -> 335.29 MiB (2.85%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 20, 2025
@rust-log-analyzer

This comment has been minimized.

@nikic
Copy link
Contributor Author

nikic commented Jan 27, 2025

The compiler-rt build (via compiler-builtins) for aarch64-unknown-uefi on test-various fails with:

warning: compiler_builtins@0.1.143: In file included from /checkout/src/llvm-project/compiler-rt/lib/builtins/cpu_model/aarch64.c:52:
warning: compiler_builtins@0.1.143: /checkout/src/llvm-project/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/windows.inc:2:10: fatal error: 'windows.h' file not found                                                                 
warning: compiler_builtins@0.1.143: #include <windows.h>
warning: compiler_builtins@0.1.143:          ^~~~~~~~~~~
warning: compiler_builtins@0.1.143: 1 error generated.
error: failed to run custom build command for `compiler_builtins v0.1.143`   

The compilation command is:

  error occurred: Command "sccache" "clang-11" "-O3" "-ffunction-sections" "-fdata-sections" "--target=aarch64-unknown-windows-gnu" "-I" "/checkout/src/llvm-project/compiler-rt/lib/builtins" "-ffunction-sections" "-fdata-sections" "--target=aarch64-unknown-windows-gnu" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-I/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/aarch64-unknown-uefi/release/build/compiler_builtins-de67acc96632c56e/out/include" "-fomit-frame-pointer" "-ffile-prefix-map=/checkout/src/llvm-project/compiler-rt=." "-DCOMPILER_RT_HAS_FLOAT16" "-DVISIBILITY_HIDDEN" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/aarch64-unknown-uefi/release/build/compiler_builtins-de67acc96632c56e/out/670c1ed24249df13-aarch64.o" "-c" "/checkout/src/llvm-project/compiler-rt/lib/builtins/cpu_model/aarch64.c" with args clang-11 did not execute successfully (status code exit status: 1).

Related upstream change: llvm/llvm-project#116706

@klensy
Copy link
Contributor

klensy commented Jan 27, 2025

clang-11

What's wrong with version?

@nikic
Copy link
Contributor Author

nikic commented Jan 30, 2025

Testing host-aarch64.

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2025
Update to LLVM 20

LLVM 20 GA is scheduled for March 11th. Rust 1.86 will be stable on April 3rd.

* [x] rust-lang#135764
* [x] rust-lang#136134
* [x] rust-lang/compiler-builtins#752
* [ ] Update compiler-builtins

Tested: arm-android, test-various, x86_64-rust-for-linux, x86_64-fuchsia, dist-various-1, dist-various-2, dist-s390x-linux, dist-riscv64-linux, dist-loongarch64-musl

try-job: aarch64-gnu
try-job: aarch64-gnu-debug
try-job: dist-aarch64-linux
@bors
Copy link
Contributor

bors commented Jan 30, 2025

⌛ Trying commit 881aa2d with merge 93cf5c1...

@bors
Copy link
Contributor

bors commented Jan 30, 2025

☀️ Try build successful - checks-actions
Build commit: 93cf5c1 (93cf5c1ddb32e8f3a9fcdd8cd2cf78079ed6c78a)

@nikic
Copy link
Contributor Author

nikic commented Jan 30, 2025

Testing macos.

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2025
Update to LLVM 20

LLVM 20 GA is scheduled for March 11th. Rust 1.86 will be stable on April 3rd.

* [x] rust-lang#135764
* [x] rust-lang#136134
* [x] rust-lang/compiler-builtins#752
* [ ] Update compiler-builtins

Tested: arm-android, test-various, x86_64-rust-for-linux, x86_64-fuchsia, dist-various-1, dist-various-2, dist-s390x-linux, dist-riscv64-linux, dist-loongarch64-musl

try-job: dist-x86_64-apple
try-job: dist-apple-various
try-job: x86_64-apple-1
try-job: x86_64-apple-2
try-job: dist-aarch64-apple
try-job: aarch64-apple
@bors
Copy link
Contributor

bors commented Jan 30, 2025

⌛ Trying commit 881aa2d with merge 92ffaa8...

@bors
Copy link
Contributor

bors commented Jan 30, 2025

☀️ Try build successful - checks-actions
Build commit: 92ffaa8 (92ffaa8cf69eca51dee2346f614ba8e990f37f34)

@nikic
Copy link
Contributor Author

nikic commented Jan 30, 2025

Testing mingw.

@bors try

@bors
Copy link
Contributor

bors commented Jan 30, 2025

⌛ Trying commit 881aa2d with merge 6ff8ac7...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2025
Update to LLVM 20

LLVM 20 GA is scheduled for March 11th. Rust 1.86 will be stable on April 3rd.

* [x] rust-lang#135764
* [x] rust-lang#136134
* [x] rust-lang/compiler-builtins#752
* [ ] Update compiler-builtins

Tested: arm-android, test-various, x86_64-rust-for-linux, x86_64-fuchsia, dist-various-1, dist-various-2, dist-s390x-linux, dist-riscv64-linux, dist-loongarch64-musl

try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
try-job: dist-i686-mingw
try-job: dist-x86_64-mingw
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 17, 2025

💔 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 Feb 17, 2025
@nikic
Copy link
Contributor Author

nikic commented Feb 17, 2025

Looks like crosstool-ng for loongarch was updated since I last tested it, possibly related? cc @heiher

@DianQK
Copy link
Member

DianQK commented Feb 17, 2025

This seems similar to the issue reported at https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=1089921. Should add -mcmodel=medium?

@heiher
Copy link
Contributor

heiher commented Feb 17, 2025

Looks like crosstool-ng for loongarch was updated since I last tested it, possibly related? cc @heiher

I believe it is unrelated to updating crosstool-ng.

This seems similar to the issue reported at https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=1089921. Should add -mcmodel=medium?

I also think it's an issue with the small code model, where changes in the C code or changes in the order of symbols during linking have caused the relevant symbols to become more distant from each other.

@heiher
Copy link
Contributor

heiher commented Feb 17, 2025

Could you try building with this patch?

@nikic
Copy link
Contributor Author

nikic commented Feb 17, 2025

Thanks, I'll try that.

I also noticed that the default code model in the target docs is outdated. Updated in #137166.

@heiher
Copy link
Contributor

heiher commented Feb 17, 2025

Thanks, I'll try that.

I also noticed that the default code model in the target docs is outdated. Updated in #137166.

Thanks.

@heiher
Copy link
Contributor

heiher commented Feb 17, 2025

It seems that the overflow symbols are in the pre-compiled object files of the loongarch64-unknown-linux-gnu toolchain. This should require configuring crosstool-ng to use the medium code model.

@heiher
Copy link
Contributor

heiher commented Feb 17, 2025

It seems that the overflow symbols are in the pre-compiled object files of the loongarch64-unknown-linux-gnu toolchain. This should require configuring crosstool-ng to use the medium code model.

Patch: heiher@2d875c3

The medium code model is already the default on the Rust side.
Make sure that linked in C objects (e.g. from glibc) also use
medium code model.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Feb 17, 2025
@nikic
Copy link
Contributor Author

nikic commented Feb 17, 2025

Confirmed that the second variant works for both dist-loongarch64-linux and dist-loongarch64-musl.

@bors r=cuviper

@bors
Copy link
Contributor

bors commented Feb 17, 2025

📌 Commit 1873bd3 has been approved by cuviper

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 Feb 17, 2025
@bors
Copy link
Contributor

bors commented Feb 17, 2025

⌛ Testing commit 1873bd3 with merge ce36a96...

@bors
Copy link
Contributor

bors commented Feb 17, 2025

☀️ Test successful - checks-actions
Approved by: cuviper
Pushing ce36a96 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 17, 2025
@bors bors merged commit ce36a96 into rust-lang:master Feb 17, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 17, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ce36a96): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
5.1% [0.2%, 35.1%] 8
Regressions ❌
(secondary)
0.7% [0.4%, 1.0%] 10
Improvements ✅
(primary)
-1.3% [-4.2%, -0.2%] 251
Improvements ✅
(secondary)
-1.0% [-4.7%, -0.1%] 178
All ❌✅ (primary) -1.1% [-4.2%, 35.1%] 259

Max RSS (memory usage)

Results (primary 0.3%, secondary 2.9%)

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.8% [1.0%, 2.4%] 6
Regressions ❌
(secondary)
2.9% [2.0%, 4.2%] 11
Improvements ✅
(primary)
-1.5% [-2.2%, -0.7%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-2.2%, 2.4%] 11

Cycles

Results (primary -1.5%, secondary -5.2%)

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)
21.2% [2.7%, 39.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.1% [-4.0%, -0.7%] 73
Improvements ✅
(secondary)
-5.2% [-14.4%, -1.5%] 33
All ❌✅ (primary) -1.5% [-4.0%, 39.7%] 75

Binary size

Results (primary -1.3%, secondary -3.0%)

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.2% [0.1%, 0.4%] 12
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-7.2%, -0.0%] 93
Improvements ✅
(secondary)
-3.0% [-7.3%, -0.0%] 92
All ❌✅ (primary) -1.3% [-7.2%, 0.4%] 105

Bootstrap: 787.551s -> 774.698s (-1.63%)
Artifact size: 350.23 MiB -> 362.37 MiB (3.47%)

@Kobzol
Copy link
Contributor

Kobzol commented Feb 18, 2025

Wins dominate the small regressions. The only large regression is on an opt incremental build, possibly a CGU got shuffled badly.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. relnotes Marks issues that should be documented in the release notes of the next release. 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. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.