Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit acffa7f

Browse files
committedSep 17, 2024·
Update the minimum external LLVM to 18
1 parent f609b7e commit acffa7f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+88
-400
lines changed
 

‎compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
465465
cx.type_array(cx.type_i8(), self.ret.layout.size.bytes()),
466466
);
467467
attributes::apply_to_llfn(llfn, llvm::AttributePlace::Argument(i), &[sret]);
468-
if cx.sess().opts.optimize != config::OptLevel::No
469-
&& llvm_util::get_version() >= (18, 0, 0)
470-
{
468+
if cx.sess().opts.optimize != config::OptLevel::No {
471469
attributes::apply_to_llfn(
472470
llfn,
473471
llvm::AttributePlace::Argument(i),

‎compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ use smallvec::SmallVec;
2626
use tracing::{debug, instrument};
2727

2828
use crate::abi::FnAbiLlvmExt;
29+
use crate::attributes;
2930
use crate::common::Funclet;
3031
use crate::context::CodegenCx;
3132
use crate::llvm::{self, AtomicOrdering, AtomicRmwBinOp, BasicBlock, False, True};
3233
use crate::type_::Type;
3334
use crate::type_of::LayoutLlvmExt;
3435
use crate::value::Value;
35-
use crate::{attributes, llvm_util};
3636

3737
// All Builders must have an llfn associated with them
3838
#[must_use]
@@ -1317,15 +1317,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
13171317
}
13181318

13191319
fn apply_attrs_to_cleanup_callsite(&mut self, llret: &'ll Value) {
1320-
if llvm_util::get_version() < (17, 0, 2) {
1321-
// Work around https://github.com/llvm/llvm-project/issues/66984.
1322-
let noinline = llvm::AttributeKind::NoInline.create_attr(self.llcx);
1323-
attributes::apply_to_callsite(llret, llvm::AttributePlace::Function, &[noinline]);
1324-
} else {
1325-
// Cleanup is always the cold path.
1326-
let cold_inline = llvm::AttributeKind::Cold.create_attr(self.llcx);
1327-
attributes::apply_to_callsite(llret, llvm::AttributePlace::Function, &[cold_inline]);
1328-
}
1320+
// Cleanup is always the cold path.
1321+
let cold_inline = llvm::AttributeKind::Cold.create_attr(self.llcx);
1322+
attributes::apply_to_callsite(llret, llvm::AttributePlace::Function, &[cold_inline]);
13291323
}
13301324
}
13311325

@@ -1767,8 +1761,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
17671761
) {
17681762
debug!("mcdc_parameters() with args ({:?}, {:?}, {:?})", fn_name, hash, bitmap_bytes);
17691763

1770-
assert!(llvm_util::get_version() >= (18, 0, 0), "MCDC intrinsics require LLVM 18 or later");
1771-
17721764
let llfn = unsafe { llvm::LLVMRustGetInstrProfMCDCParametersIntrinsic(self.cx().llmod) };
17731765
let llty = self.cx.type_func(
17741766
&[self.cx.type_ptr(), self.cx.type_i64(), self.cx.type_i32()],
@@ -1802,7 +1794,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
18021794
"mcdc_tvbitmap_update() with args ({:?}, {:?}, {:?}, {:?}, {:?})",
18031795
fn_name, hash, bitmap_bytes, bitmap_index, mcdc_temp
18041796
);
1805-
assert!(llvm_util::get_version() >= (18, 0, 0), "MCDC intrinsics require LLVM 18 or later");
18061797

18071798
let llfn =
18081799
unsafe { llvm::LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(self.cx().llmod) };
@@ -1844,7 +1835,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
18441835
"mcdc_condbitmap_update() with args ({:?}, {:?}, {:?}, {:?}, {:?})",
18451836
fn_name, hash, cond_loc, mcdc_temp, bool_value
18461837
);
1847-
assert!(llvm_util::get_version() >= (18, 0, 0), "MCDC intrinsics require LLVM 18 or later");
18481838
let llfn = unsafe { llvm::LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(self.cx().llmod) };
18491839
let llty = self.cx.type_func(
18501840
&[

0 commit comments

Comments
 (0)
Please sign in to comment.