File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/rustc_codegen_llvm/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2368,16 +2368,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
23682368 // byte swap is no-op for i8/u8
23692369 sym:: simd_bswap if int_size == 8 => Ok ( args[ 0 ] . immediate ( ) ) ,
23702370 sym:: simd_ctlz | sym:: simd_cttz => {
2371- // this fun bonus i1 arg means "poison if the arg vector contains zero"
2371+ // for the (int, i1 immediate) pair, the second arg adds `(0, true) => poison`
23722372 let fn_ty = bx. type_func ( & [ vec_ty, bx. type_i1 ( ) ] , vec_ty) ;
2373+ let dont_poison_on_zero = bx. const_int ( bx. type_i1 ( ) , 0 ) ;
23732374 let f = bx. declare_cfn ( llvm_intrinsic, llvm:: UnnamedAddr :: No , fn_ty) ;
23742375 Ok ( bx. call (
23752376 fn_ty,
23762377 None ,
23772378 None ,
23782379 f,
2379- // simd_ctlz and simd_cttz are exposed to safe code, so let's not poison anything
2380- & [ args[ 0 ] . immediate ( ) , bx. const_int ( bx. type_i1 ( ) , 0 ) ] ,
2380+ & [ args[ 0 ] . immediate ( ) , dont_poison_on_zero] ,
23812381 None ,
23822382 None ,
23832383 ) )
You can’t perform that action at this time.
0 commit comments