Skip to content

Commit 7284232

Browse files
committed
fixup! [LoopUnroll] Introduce parallel accumulators when unrolling FP reductions.
1 parent 214c03f commit 7284232

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Transforms/Utils/LoopUnroll.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,17 +1258,13 @@ llvm::canParallelizeReductionWhenUnrolling(PHINode &Phi, Loop *L,
12581258
RecurKind RK = RdxDesc.getRecurrenceKind();
12591259
// Skip unsupported reductions.
12601260
// TODO: Handle additional reductions, including min-max reductions.
1261-
if (!(RecurrenceDescriptor::isIntegerRecurrenceKind(RK) ||
1262-
RecurrenceDescriptor::isFloatingPointRecurrenceKind(RK)) ||
1263-
RecurrenceDescriptor::isAnyOfRecurrenceKind(RK) ||
1261+
if (RecurrenceDescriptor::isAnyOfRecurrenceKind(RK) ||
12641262
RecurrenceDescriptor::isFindIVRecurrenceKind(RK) ||
12651263
RecurrenceDescriptor::isMinMaxRecurrenceKind(RK))
12661264
return std::nullopt;
12671265

1268-
if (RecurrenceDescriptor::isFloatingPointRecurrenceKind(RK)) {
1269-
if (!RdxDesc.getFastMathFlags().allowReassoc())
1266+
if (RdxDesc.hasExactFPMath())
12701267
return std::nullopt;
1271-
}
12721268

12731269
if (RdxDesc.IntermediateStore)
12741270
return std::nullopt;

0 commit comments

Comments
 (0)