[llvm] [VPlan] Ignore incoming values with constant false mask. (PR #89384)

via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 21 14:08:37 PDT 2024


================
@@ -884,18 +884,19 @@ void VPlanTransforms::clearReductionWrapFlags(VPlan &Plan) {
 
 /// Try to simplify recipe \p R.
 static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
+  using namespace llvm::VPlanPatternMatch;
   // Try to remove redundant blend recipes.
   if (auto *Blend = dyn_cast<VPBlendRecipe>(&R)) {
     VPValue *Inc0 = Blend->getIncomingValue(0);
     for (unsigned I = 1; I != Blend->getNumIncomingValues(); ++I)
-      if (Inc0 != Blend->getIncomingValue(I))
+      if (Inc0 != Blend->getIncomingValue(I) &&
+          !match(Blend->getMask(I), m_False()))
----------------
ayalz wrote:

(Ah, mentioned in the commit message as follow-up, very well.)

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


More information about the llvm-commits mailing list