[llvm] r304270 - InstructionSimplify: Remove now-redundant reachability tests, as dominates() already does them

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 18:47:24 PDT 2017


Author: dannyb
Date: Tue May 30 20:47:24 2017
New Revision: 304270

URL: http://llvm.org/viewvc/llvm-project?rev=304270&view=rev
Log:
InstructionSimplify: Remove now-redundant reachability tests, as dominates() already does them

Modified:
    llvm/trunk/lib/Analysis/InstructionSimplify.cpp

Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=304270&r1=304269&r2=304270&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Tue May 30 20:47:24 2017
@@ -103,13 +103,8 @@ static bool ValueDominatesPHI(Value *V,
     return false;
 
   // If we have a DominatorTree then do a precise test.
-  if (DT) {
-    if (!DT->isReachableFromEntry(P->getParent()))
-      return true;
-    if (!DT->isReachableFromEntry(I->getParent()))
-      return false;
+  if (DT)
     return DT->dominates(I, P);
-  }
 
   // Otherwise, if the instruction is in the entry block and is not an invoke,
   // then it obviously dominates all phi nodes.




More information about the llvm-commits mailing list