[llvm] [LV][VPlan] set FastMathFlags on EVLRecipe (PR #119847)

Shao-Ce SUN via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 18:14:43 PST 2024


================
@@ -976,8 +976,11 @@ void VPWidenIntrinsicRecipe::execute(VPTransformState &State) {
     CI->getOperandBundlesAsDefs(OpBundles);
 
   CallInst *V = State.Builder.CreateCall(VectorF, Args, OpBundles);
-
-  setFlags(V);
+  // vector-predication intrinsics only accept FMF flags, while vector intrinsic
+  // can support all flags.
+  bool VPIntrinsic = VPIntrinsic::isVPIntrinsic(VectorIntrinsicID);
+  if ((VPIntrinsic && isa<FPMathOperator>(V)) || !VPIntrinsic)
----------------
sunshaoce wrote:

`if (!VPIntrinsic || isa<FPMathOperator>(V))` is better

https://github.com/llvm/llvm-project/pull/119847


More information about the llvm-commits mailing list