Skip to content

Commit b127a0f

Browse files
erikdesjardinsInnovativeInventor
authored andcommitted
remove is_rust_llvm check, since fixes are in final llvm 14 release
1 parent 88ab319 commit b127a0f

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1236,9 +1236,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
12361236
// Cleanup is always the cold path.
12371237
attrs.push(llvm::AttributeKind::Cold.create_attr(self.llcx));
12381238

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

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1921,8 +1921,6 @@ extern "C" {
19211921
pub fn LLVMRustVersionMinor() -> u32;
19221922
pub fn LLVMRustVersionPatch() -> u32;
19231923

1924-
pub fn LLVMRustIsRustLLVM() -> bool;
1925-
19261924
/// Add LLVM module flags.
19271925
///
19281926
/// In order for Rust-C LTO to work, module flags must be compatible with Clang. What

compiler/rustc_codegen_llvm/src/llvm_util.rs

-6
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,6 @@ pub fn get_version() -> (u32, u32, u32) {
244244
}
245245
}
246246

247-
/// Returns `true` if this LLVM is Rust's bundled LLVM (and not system LLVM).
248-
pub fn is_rust_llvm() -> bool {
249-
// Can be called without initializing LLVM
250-
unsafe { llvm::LLVMRustIsRustLLVM() }
251-
}
252-
253247
pub fn print_passes() {
254248
// Can be called without initializing LLVM
255249
unsafe {

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -731,14 +731,6 @@ extern "C" uint32_t LLVMRustVersionMinor() { return LLVM_VERSION_MINOR; }
731731

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

734-
extern "C" bool LLVMRustIsRustLLVM() {
735-
#ifdef LLVM_RUSTLLVM
736-
return true;
737-
#else
738-
return false;
739-
#endif
740-
}
741-
742734
extern "C" void LLVMRustAddModuleFlag(
743735
LLVMModuleRef M,
744736
Module::ModFlagBehavior MergeBehavior,

0 commit comments

Comments
 (0)