@@ -26,13 +26,13 @@ use smallvec::SmallVec;
26
26
use tracing:: { debug, instrument} ;
27
27
28
28
use crate :: abi:: FnAbiLlvmExt ;
29
+ use crate :: attributes;
29
30
use crate :: common:: Funclet ;
30
31
use crate :: context:: CodegenCx ;
31
32
use crate :: llvm:: { self , AtomicOrdering , AtomicRmwBinOp , BasicBlock , False , True } ;
32
33
use crate :: type_:: Type ;
33
34
use crate :: type_of:: LayoutLlvmExt ;
34
35
use crate :: value:: Value ;
35
- use crate :: { attributes, llvm_util} ;
36
36
37
37
// All Builders must have an llfn associated with them
38
38
#[ must_use]
@@ -1317,15 +1317,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
1317
1317
}
1318
1318
1319
1319
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] ) ;
1329
1323
}
1330
1324
}
1331
1325
@@ -1767,8 +1761,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1767
1761
) {
1768
1762
debug ! ( "mcdc_parameters() with args ({:?}, {:?}, {:?})" , fn_name, hash, bitmap_bytes) ;
1769
1763
1770
- assert ! ( llvm_util:: get_version( ) >= ( 18 , 0 , 0 ) , "MCDC intrinsics require LLVM 18 or later" ) ;
1771
-
1772
1764
let llfn = unsafe { llvm:: LLVMRustGetInstrProfMCDCParametersIntrinsic ( self . cx ( ) . llmod ) } ;
1773
1765
let llty = self . cx . type_func (
1774
1766
& [ self . cx . type_ptr ( ) , self . cx . type_i64 ( ) , self . cx . type_i32 ( ) ] ,
@@ -1802,7 +1794,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1802
1794
"mcdc_tvbitmap_update() with args ({:?}, {:?}, {:?}, {:?}, {:?})" ,
1803
1795
fn_name, hash, bitmap_bytes, bitmap_index, mcdc_temp
1804
1796
) ;
1805
- assert ! ( llvm_util:: get_version( ) >= ( 18 , 0 , 0 ) , "MCDC intrinsics require LLVM 18 or later" ) ;
1806
1797
1807
1798
let llfn =
1808
1799
unsafe { llvm:: LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic ( self . cx ( ) . llmod ) } ;
@@ -1844,7 +1835,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1844
1835
"mcdc_condbitmap_update() with args ({:?}, {:?}, {:?}, {:?}, {:?})" ,
1845
1836
fn_name, hash, cond_loc, mcdc_temp, bool_value
1846
1837
) ;
1847
- assert ! ( llvm_util:: get_version( ) >= ( 18 , 0 , 0 ) , "MCDC intrinsics require LLVM 18 or later" ) ;
1848
1838
let llfn = unsafe { llvm:: LLVMRustGetInstrProfMCDCCondBitmapIntrinsic ( self . cx ( ) . llmod ) } ;
1849
1839
let llty = self . cx . type_func (
1850
1840
& [
0 commit comments