Skip to content

Commit 71ff663

Browse files
committed
InstructionSimplify: Remove now-redundant reachability tests, as dominates() already does them
llvm-svn: 304270
1 parent b745804 commit 71ff663

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,8 @@ static bool ValueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) {
103103
return false;
104104

105105
// If we have a DominatorTree then do a precise test.
106-
if (DT) {
107-
if (!DT->isReachableFromEntry(P->getParent()))
108-
return true;
109-
if (!DT->isReachableFromEntry(I->getParent()))
110-
return false;
106+
if (DT)
111107
return DT->dominates(I, P);
112-
}
113108

114109
// Otherwise, if the instruction is in the entry block and is not an invoke,
115110
// then it obviously dominates all phi nodes.

0 commit comments

Comments
 (0)