[llvm] [LV] Support EVL for partial reduction and VPExpressionRecipe. (PR #205741)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 18:56:26 PDT 2026


================
@@ -227,6 +227,31 @@ static VPRecipeBase *optimizeMaskToEVL(VPValue *HeaderMask,
                                            Mask ? Mask : Plan->getTrue(), &EVL},
                                           IntrR->getScalarType(), {}, {}, DL);
 
+  // Transforms the VPReductionRecipe inside the VPExpressionRecipe.
+  if (auto *Expr = dyn_cast<VPExpressionRecipe>(&CurRecipe))
+    if (match(Expr->getOperand(Expr->getNumOperands() - 1),
+              m_RemoveMask(HeaderMask, Mask))) {
+      // Decompose first and construct with EVL recipes later.
+      SmallVector<VPSingleDefRecipe *> ExpressionRecipes(Expr->decompose());
----------------
ElvisWang123 wrote:

Yes, it will be removed at the end of the EVL transormation.

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


More information about the llvm-commits mailing list