Skip to content

Commit 03245db

Browse files
committed
Mark partial reductions as additional simplifications
1 parent 78948b5 commit 03245db

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
@@ -7606,6 +7606,11 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
76067606
}
76077607
continue;
76087608
}
7609+
// A partial reduction is very differently costed compared to its
7610+
// underlying add instruction that the legacy cost model sees, so consider
7611+
// it an additional simplification.
7612+
if (dyn_cast<VPPartialReductionRecipe>(&R))
7613+
continue;
76097614
if (Instruction *UI = GetInstructionForCost(&R))
76107615
SeenInstrs.insert(UI);
76117616
}

0 commit comments

Comments
 (0)