Skip to content

Commit 5999a64

Browse files
committed
Mark partial reductions as additional simplifications
1 parent 48dfa47 commit 5999a64

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7575,6 +7575,11 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
75757575
}
75767576
continue;
75777577
}
7578+
// A partial reduction is very differently costed compared to its
7579+
// underlying add instruction that the legacy cost model sees, so consider
7580+
// it an additional simplification.
7581+
if (dyn_cast<VPPartialReductionRecipe>(&R))
7582+
continue;
75787583
if (Instruction *UI = GetInstructionForCost(&R))
75797584
SeenInstrs.insert(UI);
75807585
}

0 commit comments

Comments
 (0)