Skip to content

Commit 5266aa7

Browse files
remove is_rust_llvm check, since fixes are in final llvm 14 release
1 parent 597ed3e commit 5266aa7

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
@@ -1195,9 +1195,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
11951195
// Cleanup is always the cold path.
11961196
attrs.push(llvm::AttributeKind::Cold.create_attr(self.llcx));
11971197

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

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1929,8 +1929,6 @@ extern "C" {
19291929
pub fn LLVMRustVersionMinor() -> u32;
19301930
pub fn LLVMRustVersionPatch() -> u32;
19311931

1932-
pub fn LLVMRustIsRustLLVM() -> bool;
1933-
19341932
/// Add LLVM module flags.
19351933
///
19361934
/// 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
@@ -261,12 +261,6 @@ pub fn get_version() -> (u32, u32, u32) {
261261
}
262262
}
263263

264-
/// Returns `true` if this LLVM is Rust's bundled LLVM (and not system LLVM).
265-
pub fn is_rust_llvm() -> bool {
266-
// Can be called without initializing LLVM
267-
unsafe { llvm::LLVMRustIsRustLLVM() }
268-
}
269-
270264
pub fn print_passes() {
271265
// Can be called without initializing LLVM
272266
unsafe {

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

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

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

666-
extern "C" bool LLVMRustIsRustLLVM() {
667-
#ifdef LLVM_RUSTLLVM
668-
return true;
669-
#else
670-
return false;
671-
#endif
672-
}
673-
674666
extern "C" void LLVMRustAddModuleFlag(
675667
LLVMModuleRef M,
676668
Module::ModFlagBehavior MergeBehavior,

0 commit comments

Comments
 (0)