Skip to content

Commit 9639ac9

Browse files
committed
!fixup use none_of, check if DefV is in Ends.
1 parent 50e7d74 commit 9639ac9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
527527

528528
// Ignore recipes that are never used within the loop and do not have side
529529
// effects.
530-
if (all_of(R->definedValues(),
531-
[&Ends](VPValue *Def) { return !Ends.count(Def); }) &&
530+
if (none_of(R->definedValues(),
531+
[&Ends](VPValue *Def) { return Ends.count(Def); }) &&
532532
!R->mayHaveSideEffects())
533533
continue;
534534

@@ -596,7 +596,8 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
596596
// Add the VPValues defined by the current recipe to the list of open
597597
// intervals.
598598
for (VPValue *DefV : R->definedValues())
599-
OpenIntervals.insert(DefV);
599+
if (Ends.contains(DefV))
600+
OpenIntervals.insert(DefV);
600601
}
601602

602603
// We also search for instructions that are defined outside the loop, but are

0 commit comments

Comments
 (0)