Skip to content

Commit

Permalink
remove is_rust_llvm check, since fixes are in final llvm 14 release
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Mar 11, 2022
1 parent 597ed3e commit 5266aa7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1195,9 +1195,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
// Cleanup is always the cold path.
attrs.push(llvm::AttributeKind::Cold.create_attr(self.llcx));

// In LLVM versions with deferred inlining (currently, system LLVM < 14),
// LLVM 14 contains fixes for catastrophic inlining behavior, without which
// inlining drop glue can lead to exponential size blowup, see #41696 and #92110.
if !llvm_util::is_rust_llvm() && llvm_util::get_version() < (14, 0, 0) {
if llvm_util::get_version() < (14, 0, 0) {
attrs.push(llvm::AttributeKind::NoInline.create_attr(self.llcx));
}

Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1929,8 +1929,6 @@ extern "C" {
pub fn LLVMRustVersionMinor() -> u32;
pub fn LLVMRustVersionPatch() -> u32;

pub fn LLVMRustIsRustLLVM() -> bool;

/// Add LLVM module flags.
///
/// In order for Rust-C LTO to work, module flags must be compatible with Clang. What
Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,6 @@ pub fn get_version() -> (u32, u32, u32) {
}
}

/// Returns `true` if this LLVM is Rust's bundled LLVM (and not system LLVM).
pub fn is_rust_llvm() -> bool {
// Can be called without initializing LLVM
unsafe { llvm::LLVMRustIsRustLLVM() }
}

pub fn print_passes() {
// Can be called without initializing LLVM
unsafe {
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,6 @@ extern "C" uint32_t LLVMRustVersionMinor() { return LLVM_VERSION_MINOR; }

extern "C" uint32_t LLVMRustVersionMajor() { return LLVM_VERSION_MAJOR; }

extern "C" bool LLVMRustIsRustLLVM() {
#ifdef LLVM_RUSTLLVM
return true;
#else
return false;
#endif
}

extern "C" void LLVMRustAddModuleFlag(
LLVMModuleRef M,
Module::ModFlagBehavior MergeBehavior,
Expand Down

0 comments on commit 5266aa7

Please sign in to comment.