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

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 23:40:58 PST 2025


================
@@ -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)
----------------
LiqinWeng wrote:

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

I think it should be kept, it will be more logical

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


More information about the llvm-commits mailing list