Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.
[oota-llvm.git] / lib / Transforms / Utils / Mem2Reg.cpp
index d9f665f5060082fe1493c41e2d81227a125c665b..99203b662120eaa697ee6a243d2b76122d810010 100644 (file)
@@ -20,7 +20,6 @@
 #include "llvm/Instructions.h"
 #include "llvm/Function.h"
 #include "llvm/ADT/Statistic.h"
-#include "llvm/Support/Compiler.h"
 using namespace llvm;
 
 STATISTIC(NumPromoted, "Number of alloca's promoted");
@@ -45,7 +44,6 @@ namespace {
       AU.addPreserved<UnifyFunctionExitNodes>();
       AU.addPreservedID(LowerSwitchID);
       AU.addPreservedID(LowerInvokePassID);
-      AU.addPreservedID(LowerAllocationsID);
     }
   };
 }  // end of anonymous namespace
@@ -75,7 +73,7 @@ bool PromotePass::runOnFunction(Function &F) {
 
     if (Allocas.empty()) break;
 
-    PromoteMemToReg(Allocas, DT, DF, F.getContext());
+    PromoteMemToReg(Allocas, DT, DF);
     NumPromoted += Allocas.size();
     Changed = true;
   }