-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
trans: Consolidate creating pass manager builders #27224
Conversation
The LTO pass in the compiler forgot to call the `LLVMRustAddBuilderLibraryInfo` function and configure other options such as merge_functions, vectorize_slp, etc. This ended up causing linker errors on MSVC targets because the optimizer didn't have the right knowledge that some system functions are missing on these platforms. This commit consolidates creation of PassManagerBuilder instances to one function which is then called when needed. This ensures that the pass manager is always correctly configured with the various target-specific information that LLVM needs. Overall, this fixes `-C lto -C opt-level=3` on 32-bit MSVC targets.
r? @jroesch (rust_highfive has picked a reviewer for you, use r? to override) |
r? @brson Also note that the diff looks a little better without looking at whitespace |
It's not obvious that you want to use the same inlining thresholds for the LTO optimization vs. regular compilation. |
I suppose, but that's also not really the point of this patch. Do you think it'll be harmful enough to separate out those parts? I suspect that nothing much will change as a result of this. |
It's probably harmless as long as we don't end up calling LLVMRustAddAlwaysInlinePass in LTO mode. |
@bors r+ |
📌 Commit 70e8220 has been approved by |
The LTO pass in the compiler forgot to call the `LLVMRustAddBuilderLibraryInfo` function and configure other options such as merge_functions, vectorize_slp, etc. This ended up causing linker errors on MSVC targets because the optimizer didn't have the right knowledge that some system functions are missing on these platforms. This commit consolidates creation of PassManagerBuilder instances to one function which is then called when needed. This ensures that the pass manager is always correctly configured with the various target-specific information that LLVM needs. Overall, this fixes `-C lto -C opt-level=3` on 32-bit MSVC targets.
⌛ Testing commit 70e8220 with merge 69ca012... |
re-enable lto_build test on 32-bit MSVC re-enable lto_build test on 32-bit MSVC. Because rust-lang/rust#27224 landed.
The LTO pass in the compiler forgot to call the
LLVMRustAddBuilderLibraryInfo
function and configure other options such as merge_functions, vectorize_slp,
etc. This ended up causing linker errors on MSVC targets because the optimizer
didn't have the right knowledge that some system functions are missing on these
platforms.
This commit consolidates creation of PassManagerBuilder instances to one
function which is then called when needed. This ensures that the pass manager is
always correctly configured with the various target-specific information that
LLVM needs.
Overall, this fixes
-C lto -C opt-level=3
on 32-bit MSVC targets.