[llvm] [LV] Simplify Blend/Select chain for tail folding outer loop reductions (PR #209659)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 14 23:11:00 PDT 2026
================
@@ -1701,6 +1701,21 @@ static void simplifyRecipe(VPSingleDefRecipe *Def) {
return;
}
+ // Simplify (select %mask0, (select %mask1, %T, %F), %F) -> (select
+ // (logical-and %mask0, %mask1), %T, %F) This is useful for exit value for
+ // predicated outer loop reductions with tail-folding which will generate a
+ // blend recipe for predication and a select for tail-folding.
+ VPValue *Mask0, *Mask1, *F;
+ if (match(Def, m_SelectLike(m_VPValue(Mask0), m_VPValue(X), m_VPValue(F)))) {
----------------
lukel97 wrote:
We should probably guard this behind `CanCreateNewRecipe`
https://github.com/llvm/llvm-project/pull/209659
More information about the llvm-commits
mailing list