[llvm] [LLVM][VPlan] Keep all VPBlend masks until VPlan transformation. (PR #104015)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 16:11:37 PDT 2024


================
@@ -989,15 +989,47 @@ 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);
+    // Try to remove redundant blend recipes.
+    SmallPtrSet<VPValue *, 4> UniqueValues;
----------------
ayalz wrote:

UniqueValues is used here only for checking if all non-masked-out operands are the same, which is more simply done by comparing them to the first non-masked-out operand, as the previous implementation was doing (assuming first operand is not masked out).

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


More information about the llvm-commits mailing list