//
// The LLVM Compiler Infrastructure
//
-// This file was developed by Devang Patel 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.
//
//===----------------------------------------------------------------------===//
//
// LCSSA form makes instruction renaming easier.
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequiredID(LoopSimplifyID);
+ AU.addPreservedID(LoopSimplifyID);
AU.addRequiredID(LCSSAID);
AU.addPreservedID(LCSSAID);
AU.addPreserved<ScalarEvolution>();
AU.addPreserved<LoopInfo>();
- AU.addRequiredID(LoopSimplifyID);
- AU.addPreservedID(LoopSimplifyID);
AU.addPreserved<DominatorTree>();
- // Request DominanceFrontier now, even though Loop Rotate does
- // not use it. This allows Pass Manager to schedule Dominance
- // Frontier early enough such that one LPPassManager can handle
- // loop rotate as well as licm pass.
- AU.addRequired<DominanceFrontier>();
AU.addPreserved<DominanceFrontier>();
}
BranchInst *BI = dyn_cast<BranchInst>(OrigHeader->getTerminator());
if (!BI)
return false;
- assert (BI->isConditional() && "Branch Instruction is not condiitional");
+ assert (BI->isConditional() && "Branch Instruction is not conditional");
// Updating PHInodes in loops with multiple exits adds complexity.
// Keep it simple, and restrict loop rotation to loops with one exit only.
// In future, lift this restriction and support for multiple exits if
// required.
- std::vector<BasicBlock *> ExitBlocks;
+ SmallVector<BasicBlock*, 8> ExitBlocks;
L->getExitBlocks(ExitBlocks);
if (ExitBlocks.size() > 1)
return false;
NewHeader);
LoopInfo &LI = LPM.getAnalysis<LoopInfo>();
if (Loop *PL = LI.getLoopFor(OrigPreHeader))
- PL->addBasicBlockToLoop(NewPreHeader, LI);
+ PL->addBasicBlockToLoop(NewPreHeader, LI.getBase());
new BranchInst(NewHeader, NewPreHeader);
BranchInst *OrigPH_BI = cast<BranchInst>(OrigPreHeader->getTerminator());