File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -7651,9 +7651,8 @@ static bool isGuaranteedNotToBeUndefOrPoison(
76517651 return true ;
76527652 }
76537653
7654- if (!::canCreateUndefOrPoison (Opr, Kind,
7655- /* ConsiderFlagsAndMetadata=*/ true )) {
7656- if (const auto *PN = dyn_cast<PHINode>(V)) {
7654+ if (const auto *PN = dyn_cast<PHINode>(V)) {
7655+ if (!includesPoison (Kind) || !PN->hasPoisonGeneratingFlags ()) {
76577656 unsigned Num = PN->getNumIncomingValues ();
76587657 bool IsWellDefined = true ;
76597658 for (unsigned i = 0 ; i < Num; ++i) {
@@ -7668,9 +7667,11 @@ static bool isGuaranteedNotToBeUndefOrPoison(
76687667 }
76697668 if (IsWellDefined)
76707669 return true ;
7671- } else if (all_of (Opr->operands (), OpCheck))
7672- return true ;
7673- }
7670+ }
7671+ } else if (!::canCreateUndefOrPoison (Opr, Kind,
7672+ /* ConsiderFlagsAndMetadata=*/ true ) &&
7673+ all_of (Opr->operands (), OpCheck))
7674+ return true ;
76747675 }
76757676
76767677 if (auto *I = dyn_cast<LoadInst>(V))
You can’t perform that action at this time.
0 commit comments