Restore #![no_builtins] crates participation in LTO.#113923
Restore #![no_builtins] crates participation in LTO.#113923bors merged 10 commits intorust-lang:masterfrom
#![no_builtins] crates participation in LTO.#113923Conversation
This comment has been minimized.
This comment has been minimized.
5896550 to
beaa1ea
Compare
This comment has been minimized.
This comment has been minimized.
beaa1ea to
e04af60
Compare
|
Removed opaque pointers for LLVM 14. |
e04af60 to
8799b43
Compare
|
ping? @pnkfelix |
8799b43 to
c1ec76c
Compare
|
Rebase and remove the DisableSimplifyLibCalls parameter. |
|
@rustbot ready |
|
@bors r+ rollup=never |
|
⌛ Testing commit c1ec76c with merge f4589297857113e2cc3f6437f112d567b4da3694... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
Based on the error message, I believe #78744, #91158 amd rust-lang/cargo#10118 are also not participating in the LTO issue. It show |
|
@rustbot author |
|
TL;DR I renamed An interesting attempt: I can get correct results using LLVM's LTO in lld. "lld" "-flavor" "wasm" "--rsp-quoting=posix" \
"--export" "multer" "--export=__heap_base" "--export=__data_end" \
"-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--fatal-warnings" "--no-demangle" "--no-entry" \
"main.main.7fc14dcaa7e3fa65-cgu.0.rcgu.lto.input.bc" \
"-o" "main.wasm" "--gc-sections" "--no-entry" "-O3"I investigated along with this result why lld's LTO could be successful. Two issues in LLVM (or maybe not).
|
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
@bors r=pnkfelix |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (8c2b577): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 673.541s -> 672.846s (-0.10%) |
|
It seems that linking has become 10-20ms slower and binaries ~260kb bigger. Maybe we no longer gc unused compiler builtins functions? |
|
Right, those compile-time regressions are really bad :( Lots of ~5% binary size increases, too. What can be done? |
|
I believe I saw something around symbols being marked as "used". If this is currently linker used, maybe we can downgrade it to compiler used? |
I can verify that this indeed preserves builtin functions. |
This should be the right way to go.
I will start debugging with your analysis this weekend. :) |
After #113716, we can make
#![no_builtins]crates participate in LTO again.#![no_builtins]with LTO does not result in undefined references to the error. I believe this type of issue won't happen again.Fixes #72140. Fixes #112245. Fixes #110606. Fixes #105734. Fixes #96486. Fixes #108853. Fixes #108893. Fixes #78744. Fixes #91158. Fixes rust-lang/cargo#10118. Fixes rust-lang/compiler-builtins#347.
The
nightly-2023-07-20version does not always reproduce problems due to changes in compiler-builtins, core, and user code. That's why this issue recurs and disappears.Some issues were not tested due to the difficulty of reproducing them.
r? pnkfelix
cc @bjorn3 @japaric @alexcrichton @Amanieu