[llvm] [VPlan] Propagate FastMathFlags from phis to blends (PR #180226)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 6 10:27:39 PST 2026


================
@@ -2640,20 +2642,22 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe,
 
 /// A recipe for vectorizing a phi-node as a sequence of mask-based select
 /// instructions.
-class LLVM_ABI_FOR_TEST VPBlendRecipe : public VPSingleDefRecipe {
+class LLVM_ABI_FOR_TEST VPBlendRecipe : public VPRecipeWithIRFlags {
 public:
   /// The blend operation is a User of the incoming values and of their
   /// respective masks, ordered [I0, M0, I1, M1, I2, M2, ...]. Note that M0 can
   /// be omitted (implied by passing an odd number of operands) in which case
   /// all other incoming values are merged into it.
-  VPBlendRecipe(PHINode *Phi, ArrayRef<VPValue *> Operands, DebugLoc DL)
-      : VPSingleDefRecipe(VPRecipeBase::VPBlendSC, Operands, Phi, DL) {
+  VPBlendRecipe(PHINode *Phi, ArrayRef<VPValue *> Operands,
+                const VPIRFlags &Flags, DebugLoc DL)
+      : VPRecipeWithIRFlags(VPRecipeBase::VPBlendSC, Operands, Flags, DL) {
----------------
artagnon wrote:

Would be good to generalize VPRecipeWithIRFlags to have another constructor calling the underlying-value constructor of VPSingleDefRecipe, and use that here?

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


More information about the llvm-commits mailing list