Skip to content

Revert "Disable the machine outliner by default" #88388

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

Merged
merged 1 commit into from
Aug 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ unsafe fn configure_llvm(sess: &Session) {
add("-generate-arange-section", false);
}

// FIXME(nagisa): disable the machine outliner by default in LLVM versions 11, where it was
// introduced and up.
// Disable the machine outliner by default in LLVM versions 11 and LLVM
// version 12, where it leads to miscompilation.
//
// This should remain in place until https://reviews.llvm.org/D103167 is fixed. If LLVM
// has been upgraded since, consider adjusting the version check below to contain an upper
// bound.
if llvm_util::get_version() >= (11, 0, 0) {
// Ref:
// - https://github.com/rust-lang/rust/issues/85351
// - https://reviews.llvm.org/D103167
let llvm_version = llvm_util::get_version();
if llvm_version >= (11, 0, 0) && llvm_version < (13, 0, 0) {
add("-enable-machine-outliner=never", false);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the policy on this? Should the disable only be reverted for the rust fork of LLVM or LLVM 13 and up?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say disable for >= 11.0.0 && < 12.0.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our fork of 12.0.1 doesn't contain the fix commit. https://github.com/rust-lang/llvm-project/tree/rustc/12.0-2021-07-10 So I changed the disabling range to >= 11.0.0 && < 13.0.0


Expand Down