Add an argument to PHITranslateValue to specify the DominatorTree. If this
[oota-llvm.git] / lib / Transforms / Scalar / GVN.cpp
index 164730c3ca06d0f61bef011cc8ea6ade7e28d92c..eb6b901e92938f18be0ddca550e00f2a8994d9ff 100644 (file)
@@ -1633,13 +1633,8 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
       LoadPtr = Address.PHITranslateWithInsertion(LoadBB, UnavailablePred,
                                                   *DT, NewInsts);
     } else {
-      Address.PHITranslateValue(LoadBB, UnavailablePred);
+      Address.PHITranslateValue(LoadBB, UnavailablePred, DT);
       LoadPtr = Address.getAddr();
-    
-      // Make sure the value is live in the predecessor.
-      if (Instruction *Inst = dyn_cast_or_null<Instruction>(LoadPtr))
-        if (!DT->dominates(Inst->getParent(), UnavailablePred))
-          LoadPtr = 0;
     }
 
     // If we couldn't find or insert a computation of this phi translated value,