llvm-project
d7e6268c - [msan][NFCI] Add forceIntegerIntrinsic option to handleIntrinsicByApplyingToShadow() (#207053)

Commit
2 days ago
[msan][NFCI] Add forceIntegerIntrinsic option to handleIntrinsicByApplyingToShadow() (#207053) Currently, if handleIntrinsicByApplyingToShadow() is given an IntrinsicInst with floating-point arguments, it will cast the shadows to floating-point, apply the intrinsic, and then cast the result back to integer/shadow. This is inefficient, and, depending on the intrinsic, may also result in floating-point exceptions. The user can explicitly supply an integer variant of the intrinsic to be applied to the shadow (shadowIntrinsicID), but this does not work if the integer and floating-point variants are overloaded forms of the same intrinsic ID. This patch adds an option, 'forceIntegerIntrinsic', which will pass the shadows as integers to the intrinsic, thus avoiding unnecessary casts. (This is not enabled by default since some intrinsics do not support integer arguments.) As an example, future work can use 'forceIntegerIntrinsic' to handle `<16 x float> @llvm.x86.avx512.mask.compress (<16 x float>, <16 x float>, <16 x i1> %mask)` with `<16 x i32> @llvm.x86.avx512.mask.compress (<16 x i32>, <16 x i32>, <16 x i1> %mask)`
Author
Parents
Loading