[PM] Split the LoopInfo object apart from the legacy pass, creating
[oota-llvm.git] / lib / Transforms / Utils / BreakCriticalEdges.cpp
index eda22cfc1bab25dc90fc924f4ee9910a0622b2a1..736a4a8647264f8be159ba1ac9cf79c585eb2ca2 100644 (file)
@@ -48,7 +48,7 @@ namespace {
 
     void getAnalysisUsage(AnalysisUsage &AU) const override {
       AU.addPreserved<DominatorTreeWrapperPass>();
-      AU.addPreserved<LoopInfo>();
+      AU.addPreserved<LoopInfoWrapperPass>();
 
       // No loop canonicalization guarantees are broken by this pass.
       AU.addPreservedID(LoopSimplifyID);
@@ -199,7 +199,8 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
   DominatorTreeWrapperPass *DTWP =
       P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
   DominatorTree *DT = DTWP ? &DTWP->getDomTree() : nullptr;
-  LoopInfo *LI = P->getAnalysisIfAvailable<LoopInfo>();
+  auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
+  LoopInfo *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
 
   // If we have nothing to update, just return.
   if (!DT && !LI)