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

trans: Consolidate creating pass manager builders #27224

Merged
merged 1 commit into from
Jul 24, 2015

Conversation

alexcrichton
Copy link
Member

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.

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.
@rust-highfive
Copy link
Collaborator

r? @jroesch

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

@alexcrichton
Copy link
Member Author

r? @brson

Also note that the diff looks a little better without looking at whitespace

@eefriedman
Copy link
Contributor

It's not obvious that you want to use the same inlining thresholds for the LTO optimization vs. regular compilation.

@alexcrichton
Copy link
Member Author

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.

@eefriedman
Copy link
Contributor

It's probably harmless as long as we don't end up calling LLVMRustAddAlwaysInlinePass in LTO mode.

@brson
Copy link
Contributor

brson commented Jul 23, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Jul 23, 2015

📌 Commit 70e8220 has been approved by brson

bors added a commit that referenced this pull request Jul 23, 2015
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.
@bors
Copy link
Contributor

bors commented Jul 23, 2015

⌛ Testing commit 70e8220 with merge 69ca012...

@bors bors merged commit 70e8220 into rust-lang:master Jul 24, 2015
@alexcrichton alexcrichton deleted the configure-lto-right branch August 17, 2015 19:49
bors added a commit to rust-lang/cargo that referenced this pull request Nov 22, 2021
re-enable lto_build test on 32-bit MSVC

re-enable lto_build test on 32-bit MSVC. Because rust-lang/rust#27224 landed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants