[llvm] [LV] Support EVL for partial reduction and VPExpressionRecipe. (PR #205741)
Elvis Wang via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 21:19:02 PDT 2026
================
@@ -240,6 +241,40 @@ static VPRecipeBase *optimizeMaskToEVL(VPValue *HeaderMask,
return nullptr;
}
+// Decompose the expression recipe and transform each contained recipe into
+// an EVL recipe.
+static bool
+optimizeExpressionRecipeToEVL(VPValue *HeaderMask, VPRecipeBase &CurRecipe,
+ VPValue &EVL,
+ SmallVector<VPRecipeBase *> &OldRecipes) {
+
+ auto *Expr = dyn_cast<VPExpressionRecipe>(&CurRecipe);
+ if (!Expr)
+ return false;
+
+ // Decompose first and construct with EVL recipes later.
+ SmallVector<VPSingleDefRecipe *> ExpressionRecipes(Expr->decompose());
+ SmallSetVector<VPSingleDefRecipe *, 4> UniqueExpressionRecipes(
+ ExpressionRecipes.begin(), ExpressionRecipes.end());
----------------
ElvisWang123 wrote:
UPdated, thanks!
https://github.com/llvm/llvm-project/pull/205741
More information about the llvm-commits
mailing list