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

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 04:57:33 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)
----------------
Mel-Chen wrote:

I'm thinking whether we need this check. 
Is it possible to use the existing constructor to pass in an `OpType` other than `FPMathOp` when constructing vp intrinsic?

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


More information about the llvm-commits mailing list