@@ -30,6 +30,7 @@ use smallvec::SmallVec;
30
30
use tracing:: { debug, instrument} ;
31
31
32
32
use crate :: abi:: FnAbiLlvmExt ;
33
+ use crate :: attributes;
33
34
use crate :: common:: Funclet ;
34
35
use crate :: context:: { CodegenCx , FullCx , GenericCx , SCx } ;
35
36
use crate :: llvm:: {
@@ -38,7 +39,6 @@ use crate::llvm::{
38
39
use crate :: type_:: Type ;
39
40
use crate :: type_of:: LayoutLlvmExt ;
40
41
use crate :: value:: Value ;
41
- use crate :: { attributes, llvm_util} ;
42
42
43
43
#[ must_use]
44
44
pub ( 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> {
927
927
debug_assert_ne ! ( self . val_ty( val) , dest_ty) ;
928
928
929
929
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 ) ;
935
933
}
936
934
}
937
935
trunc
@@ -941,11 +939,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
941
939
debug_assert_ne ! ( self . val_ty( val) , dest_ty) ;
942
940
943
941
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 ) ;
949
945
}
950
946
}
951
947
trunc
@@ -1899,10 +1895,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1899
1895
hash : & ' ll Value ,
1900
1896
bitmap_bits : & ' ll Value ,
1901
1897
) {
1902
- assert ! (
1903
- crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1904
- "MCDC intrinsics require LLVM 19 or later"
1905
- ) ;
1906
1898
self . call_intrinsic ( "llvm.instrprof.mcdc.parameters" , & [ fn_name, hash, bitmap_bits] ) ;
1907
1899
}
1908
1900
@@ -1914,10 +1906,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1914
1906
bitmap_index : & ' ll Value ,
1915
1907
mcdc_temp : & ' ll Value ,
1916
1908
) {
1917
- assert ! (
1918
- crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1919
- "MCDC intrinsics require LLVM 19 or later"
1920
- ) ;
1921
1909
let args = & [ fn_name, hash, bitmap_index, mcdc_temp] ;
1922
1910
self . call_intrinsic ( "llvm.instrprof.mcdc.tvbitmap.update" , args) ;
1923
1911
}
@@ -1929,10 +1917,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1929
1917
1930
1918
#[ instrument( level = "debug" , skip( self ) ) ]
1931
1919
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
- ) ;
1936
1920
let align = self . tcx . data_layout . i32_align . abi ;
1937
1921
let current_tv_index = self . load ( self . cx . type_i32 ( ) , mcdc_temp, align) ;
1938
1922
let new_tv_index = self . add ( current_tv_index, cond_index) ;
0 commit comments