Skip to content

Commit 7737c05

Browse files
committed
[VPlan] Make sure properlyDominates(A, A) returns false.
At the moment, properlyDominates(A, A) can return true via LocalComesBefore. Add an early exit to ensure it returns false if A == B. Note: no test has been added because the existing test suite covers this case already with libc++ with assertions enabled. Fixes llvm#60850.
1 parent 723cd2e commit 7737c05

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ static VPRegionBlock *GetReplicateRegion(VPRecipeBase *R) {
551551

552552
static bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B,
553553
VPDominatorTree &VPDT) {
554+
if (A == B)
555+
return false;
556+
554557
auto LocalComesBefore = [](const VPRecipeBase *A, const VPRecipeBase *B) {
555558
for (auto &R : *A->getParent()) {
556559
if (&R == A)

0 commit comments

Comments
 (0)