Skip to content

Commit c21cceb

Browse files
committed
[VPlan] Use usesScalars in shouldPack.
Suggested by @ayal as follow-up improvement in D143864. I was unable to find a case where this actually changes generated code, but it is a unifying code to use common infrastructure.
1 parent 028c722 commit c21cceb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,9 @@ bool VPReplicateRecipe::shouldPack() const {
926926
// VPPredInstPHIRecipe. In this case, also pack the scalar values in a vector.
927927
return any_of(users(), [](const VPUser *U) {
928928
if (auto *PredR = dyn_cast<VPPredInstPHIRecipe>(U))
929-
return any_of(PredR->users(),
930-
[](const VPUser *U) { return !isa<VPReplicateRecipe>(U); });
929+
return any_of(PredR->users(), [PredR](const VPUser *U) {
930+
return !U->usesScalars(PredR);
931+
});
931932
return false;
932933
});
933934
}

0 commit comments

Comments
 (0)