Remove printout, realize that instructions in the entry block dominate all
authorChris Lattner <sabre@nondot.org>
Sun, 17 Oct 2004 21:31:34 +0000 (21:31 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 17 Oct 2004 21:31:34 +0000 (21:31 +0000)
other blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17099 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 784e80429d9f22a44249f16574b4356ee424c572..e3c45d40fb25b217b03e20a4e673df9e7d1b27cc 100644 (file)
@@ -3386,12 +3386,12 @@ Instruction *InstCombiner::visitPHINode(PHINode &PN) {
     if (Instruction *I = dyn_cast<Instruction>(V)) {
       // We know that the instruction dominates the PHI if there are no undef
       // values coming in.
-      for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
-        if (isa<UndefValue>(PN.getIncomingValue(i))) {
-          std::cerr << "HAD TO DISABLE PHI ELIM IN IC!\n";
-          V = 0;
-          break;
-        }
+      if (I->getParent() != &I->getParent()->getParent()->front())
+        for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
+          if (isa<UndefValue>(PN.getIncomingValue(i))) {
+            V = 0;
+            break;
+          }
     }
 
     if (V)