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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 06:08:27 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()))
----------------
fhahn wrote:

Will do separately, thanks!

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


More information about the llvm-commits mailing list