diff options
author | Devang Patel <dpatel@apple.com> | 2007-08-21 00:31:24 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-08-21 00:31:24 +0000 |
commit | b7211a2ce13a0365e0e1dd2f27adda2ee3d1288b (patch) | |
tree | b9ad502a1f6b2bc11758d76401b46b4660a6e4d4 /lib/Transforms/Utils | |
parent | 2d691333acec66118ede55b6d7ec7a3083bc1e01 (diff) |
Use SmallVector instead of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 12 | ||||
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 465214cba9..a936666bff 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -59,7 +59,7 @@ namespace { virtual bool runOnLoop(Loop *L, LPPassManager &LPM); void ProcessInstruction(Instruction* Instr, - const std::vector<BasicBlock*>& exitBlocks); + const SmallVector<BasicBlock*, 8>& exitBlocks); /// This transformation requires natural loop information & requires that /// loop preheaders be inserted into the CFG. It maintains both of these, @@ -107,7 +107,6 @@ bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) { LI = &LPM.getAnalysis<LoopInfo>(); DT = &getAnalysis<DominatorTree>(); - DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>(); // Speed up queries by creating a sorted list of blocks LoopBlocks.clear(); @@ -122,9 +121,8 @@ bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) { if (AffectedValues.empty()) return false; - std::vector<BasicBlock*> exitBlocks; - L->getExitBlocks(exitBlocks); - + SmallVector<BasicBlock*, 8> exitBlocks; + L->getExitBlocks(exitBlocks); // Iterate over all affected values for this loop and insert Phi nodes // for them in the appropriate exit blocks @@ -141,7 +139,7 @@ bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) { /// processInstruction - Given a live-out instruction, insert LCSSA Phi nodes, /// eliminate all out-of-loop uses. void LCSSA::ProcessInstruction(Instruction *Instr, - const std::vector<BasicBlock*>& exitBlocks) { + const SmallVector<BasicBlock*, 8>& exitBlocks) { ++NumLCSSA; // We are applying the transformation // Keep track of the blocks that have the value available already. @@ -151,7 +149,7 @@ void LCSSA::ProcessInstruction(Instruction *Instr, // Insert the LCSSA phi's into the exit blocks (dominated by the value), and // add them to the Phi's map. - for (std::vector<BasicBlock*>::const_iterator BBI = exitBlocks.begin(), + for (SmallVector<BasicBlock*, 8>::const_iterator BBI = exitBlocks.begin(), BBE = exitBlocks.end(); BBI != BBE; ++BBI) { BasicBlock *BB = *BBI; DomTreeNode *ExitBBNode = DT->getNode(BB); diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 226f364c6a..20eecd6f33 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -199,7 +199,7 @@ ReprocessLoop: // predecessors that are inside of the loop. This check guarantees that the // loop preheader/header will dominate the exit blocks. If the exit block has // predecessors from outside of the loop, split the edge now. - std::vector<BasicBlock*> ExitBlocks; + SmallVector<BasicBlock*, 8> ExitBlocks; L->getExitBlocks(ExitBlocks); SetVector<BasicBlock*> ExitBlockSet(ExitBlocks.begin(), ExitBlocks.end()); |