Skip to content

Commit 42cf9c6

Browse files
authored
[RISCV] Mark Sub/AddChainWithSubs as legal reduction types (#154753)
We used to vectorize these scalably but after #147026 they were split out from RecurKind::Add into their own RecurKinds, and we didn't mark them as supported in isLegalToVectorizeReduction. This caused the loop vectorizer to drop the scalable VPlan because it thinks the reductions will be scalarized. This fixes it by just marking them as supported. Fixes #154554
1 parent b614975 commit 42cf9c6

File tree

2 files changed

+166
-42
lines changed

2 files changed

+166
-42
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ class RISCVTTIImpl final : public BasicTTIImplBase<RISCVTTIImpl> {
372372

373373
switch (RdxDesc.getRecurrenceKind()) {
374374
case RecurKind::Add:
375+
case RecurKind::Sub:
376+
case RecurKind::AddChainWithSubs:
375377
case RecurKind::And:
376378
case RecurKind::Or:
377379
case RecurKind::Xor:

0 commit comments

Comments
 (0)