Skip to content

Commit

Permalink
[VPlan] Make sure properlyDominates(A, A) returns false.
Browse files Browse the repository at this point in the history
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 #60850.
  • Loading branch information
fhahn committed Feb 19, 2023
1 parent 723cd2e commit 7737c05
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Expand Up @@ -551,6 +551,9 @@ static VPRegionBlock *GetReplicateRegion(VPRecipeBase *R) {

static bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B,
VPDominatorTree &VPDT) {
if (A == B)
return false;

auto LocalComesBefore = [](const VPRecipeBase *A, const VPRecipeBase *B) {
for (auto &R : *A->getParent()) {
if (&R == A)
Expand Down

0 comments on commit 7737c05

Please sign in to comment.