API changes for class Use size reduction, wave 1.
[oota-llvm.git] / lib / Transforms / Scalar / GCSE.cpp
index d7194bb3d662e5a8f75775b85bed68bad4764611..39a1b257258073a123d797f30df865593bae909d 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -48,7 +48,6 @@ namespace {
     // This transformation requires dominator and immediate dominator info
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
-      AU.addRequired<ETForest>();
       AU.addRequired<DominatorTree>();
       AU.addRequired<ValueNumbering>();
     }
@@ -69,7 +68,6 @@ bool GCSE::runOnFunction(Function &F) {
 
   // Get pointers to the analysis results that we will be using...
   DominatorTree &DT = getAnalysis<DominatorTree>();
-  ETForest &ET = getAnalysis<ETForest>();
   ValueNumbering &VN = getAnalysis<ValueNumbering>();
 
   std::vector<Value*> EqualValues;
@@ -145,7 +143,7 @@ bool GCSE::runOnFunction(Function &F) {
             if (OtherI->getParent() == BB)
               Dominates = BlockInsts.count(OtherI);
             else
-              Dominates = ET.dominates(OtherI->getParent(), BB);
+              Dominates = DT.dominates(OtherI->getParent(), BB);
 
             if (Dominates) {
               // Okay, we found an instruction with the same value as this one
@@ -194,7 +192,7 @@ void GCSE::ReplaceInstructionWith(Instruction *I, Value *V) {
   if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
     // Removing an invoke instruction requires adding a branch to the normal
     // destination and removing PHI node entries in the exception destination.
-    new BranchInst(II->getNormalDest(), II);
+    BranchInst::Create(II->getNormalDest(), II);
     II->getUnwindDest()->removePredecessor(II->getParent());
   }