@@ -1006,15 +1006,6 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
10061006 let lane_clif_ty = fx. clif_type ( val_lane_ty) . unwrap ( ) ;
10071007 let ret_lane_layout = fx. layout_of ( ret_lane_ty) ;
10081008
1009- let alignment = generic_args[ 3 ] . expect_const ( ) . to_value ( ) . valtree . unwrap_branch ( ) [ 0 ]
1010- . unwrap_leaf ( )
1011- . to_simd_alignment ( ) ;
1012-
1013- let memflags = match alignment {
1014- SimdAlign :: Unaligned => MemFlags :: new ( ) . with_notrap ( ) ,
1015- _ => MemFlags :: trusted ( ) ,
1016- } ;
1017-
10181009 for lane_idx in 0 ..ptr_lane_count {
10191010 let val_lane = val. value_lane ( fx, lane_idx) . load_scalar ( fx) ;
10201011 let ptr_lane = ptr. value_lane ( fx, lane_idx) . load_scalar ( fx) ;
@@ -1030,7 +1021,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
10301021 fx. bcx . seal_block ( if_disabled) ;
10311022
10321023 fx. bcx . switch_to_block ( if_enabled) ;
1033- let res = fx. bcx . ins ( ) . load ( lane_clif_ty, memflags , ptr_lane, 0 ) ;
1024+ let res = fx. bcx . ins ( ) . load ( lane_clif_ty, MemFlags :: trusted ( ) , ptr_lane, 0 ) ;
10341025 fx. bcx . ins ( ) . jump ( next, & [ res. into ( ) ] ) ;
10351026
10361027 fx. bcx . switch_to_block ( if_disabled) ;
@@ -1059,6 +1050,15 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
10591050 let ret_lane_layout = fx. layout_of ( ret_lane_ty) ;
10601051 let ptr_val = ptr. load_scalar ( fx) ;
10611052
1053+ let alignment = generic_args[ 3 ] . expect_const ( ) . to_value ( ) . valtree . unwrap_branch ( ) [ 0 ]
1054+ . unwrap_leaf ( )
1055+ . to_simd_alignment ( ) ;
1056+
1057+ let memflags = match alignment {
1058+ SimdAlign :: Unaligned => MemFlags :: new ( ) . with_notrap ( ) ,
1059+ _ => MemFlags :: trusted ( ) ,
1060+ } ;
1061+
10621062 for lane_idx in 0 ..ret_lane_count {
10631063 let val_lane = val. value_lane ( fx, lane_idx) . load_scalar ( fx) ;
10641064 let mask_lane = mask. value_lane ( fx, lane_idx) . load_scalar ( fx) ;
@@ -1074,12 +1074,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
10741074
10751075 fx. bcx . switch_to_block ( if_enabled) ;
10761076 let offset = lane_idx as i32 * lane_clif_ty. bytes ( ) as i32 ;
1077- let res = fx. bcx . ins ( ) . load (
1078- lane_clif_ty,
1079- MemFlags :: trusted ( ) ,
1080- ptr_val,
1081- Offset32 :: new ( offset) ,
1082- ) ;
1077+ let res = fx. bcx . ins ( ) . load ( lane_clif_ty, memflags, ptr_val, Offset32 :: new ( offset) ) ;
10831078 fx. bcx . ins ( ) . jump ( next, & [ res. into ( ) ] ) ;
10841079
10851080 fx. bcx . switch_to_block ( if_disabled) ;
0 commit comments