Skip to content

Commit 2c37f58

Browse files
committed
Revert "[ValueTracking] Address review comments."
This reverts commit 7363500.
1 parent 7363500 commit 2c37f58

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7651,8 +7651,9 @@ static bool isGuaranteedNotToBeUndefOrPoison(
76517651
return true;
76527652
}
76537653

7654-
if (const auto *PN = dyn_cast<PHINode>(V)) {
7655-
if (!includesPoison(Kind) || !PN->hasPoisonGeneratingFlags()) {
7654+
if (!::canCreateUndefOrPoison(Opr, Kind,
7655+
/*ConsiderFlagsAndMetadata=*/true)) {
7656+
if (const auto *PN = dyn_cast<PHINode>(V)) {
76567657
unsigned Num = PN->getNumIncomingValues();
76577658
bool IsWellDefined = true;
76587659
for (unsigned i = 0; i < Num; ++i) {
@@ -7667,11 +7668,9 @@ static bool isGuaranteedNotToBeUndefOrPoison(
76677668
}
76687669
if (IsWellDefined)
76697670
return true;
7670-
}
7671-
} else if (!::canCreateUndefOrPoison(Opr, Kind,
7672-
/*ConsiderFlagsAndMetadata=*/true) &&
7673-
all_of(Opr->operands(), OpCheck))
7674-
return true;
7671+
} else if (all_of(Opr->operands(), OpCheck))
7672+
return true;
7673+
}
76757674
}
76767675

76777676
if (auto *I = dyn_cast<LoadInst>(V))

0 commit comments

Comments
 (0)