@@ -30,6 +30,7 @@ use smallvec::SmallVec;
3030use tracing:: { debug, instrument} ;
3131
3232use crate :: abi:: FnAbiLlvmExt ;
33+ use crate :: attributes;
3334use crate :: common:: Funclet ;
3435use crate :: context:: { CodegenCx , FullCx , GenericCx , SCx } ;
3536use crate :: llvm:: {
@@ -38,7 +39,6 @@ use crate::llvm::{
3839use crate :: type_:: Type ;
3940use crate :: type_of:: LayoutLlvmExt ;
4041use crate :: value:: Value ;
41- use crate :: { attributes, llvm_util} ;
4242
4343#[ must_use]
4444pub ( crate ) struct GenericBuilder < ' a , ' ll , CX : Borrow < SCx < ' ll > > > {
@@ -927,11 +927,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
927927 debug_assert_ne ! ( self . val_ty( val) , dest_ty) ;
928928
929929 let trunc = self . trunc ( val, dest_ty) ;
930- if llvm_util:: get_version ( ) >= ( 19 , 0 , 0 ) {
931- unsafe {
932- if llvm:: LLVMIsAInstruction ( trunc) . is_some ( ) {
933- llvm:: LLVMSetNUW ( trunc, True ) ;
934- }
930+ unsafe {
931+ if llvm:: LLVMIsAInstruction ( trunc) . is_some ( ) {
932+ llvm:: LLVMSetNUW ( trunc, True ) ;
935933 }
936934 }
937935 trunc
@@ -941,11 +939,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
941939 debug_assert_ne ! ( self . val_ty( val) , dest_ty) ;
942940
943941 let trunc = self . trunc ( val, dest_ty) ;
944- if llvm_util:: get_version ( ) >= ( 19 , 0 , 0 ) {
945- unsafe {
946- if llvm:: LLVMIsAInstruction ( trunc) . is_some ( ) {
947- llvm:: LLVMSetNSW ( trunc, True ) ;
948- }
942+ unsafe {
943+ if llvm:: LLVMIsAInstruction ( trunc) . is_some ( ) {
944+ llvm:: LLVMSetNSW ( trunc, True ) ;
949945 }
950946 }
951947 trunc
@@ -1899,10 +1895,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
18991895 hash : & ' ll Value ,
19001896 bitmap_bits : & ' ll Value ,
19011897 ) {
1902- assert ! (
1903- crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1904- "MCDC intrinsics require LLVM 19 or later"
1905- ) ;
19061898 self . call_intrinsic ( "llvm.instrprof.mcdc.parameters" , & [ fn_name, hash, bitmap_bits] ) ;
19071899 }
19081900
@@ -1914,10 +1906,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
19141906 bitmap_index : & ' ll Value ,
19151907 mcdc_temp : & ' ll Value ,
19161908 ) {
1917- assert ! (
1918- crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1919- "MCDC intrinsics require LLVM 19 or later"
1920- ) ;
19211909 let args = & [ fn_name, hash, bitmap_index, mcdc_temp] ;
19221910 self . call_intrinsic ( "llvm.instrprof.mcdc.tvbitmap.update" , args) ;
19231911 }
@@ -1929,10 +1917,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
19291917
19301918 #[ instrument( level = "debug" , skip( self ) ) ]
19311919 pub ( crate ) fn mcdc_condbitmap_update ( & mut self , cond_index : & ' ll Value , mcdc_temp : & ' ll Value ) {
1932- assert ! (
1933- crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1934- "MCDC intrinsics require LLVM 19 or later"
1935- ) ;
19361920 let align = self . tcx . data_layout . i32_align . abi ;
19371921 let current_tv_index = self . load ( self . cx . type_i32 ( ) , mcdc_temp, align) ;
19381922 let new_tv_index = self . add ( current_tv_index, cond_index) ;
0 commit comments