diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-18 22:15:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-18 22:15:13 +0000 |
commit | 35eaa55cfc8520d31e9f96a2c022de92c5bd9bbb (patch) | |
tree | 9d0198a381a2738d0d0bcd228d1ae782f051fca6 /llvm/lib/Transforms/Scalar/LICM.cpp | |
parent | d72c3eb54e73b3dfb7c6c5074951ff79bf05ba82 (diff) | |
download | bcm5719-llvm-35eaa55cfc8520d31e9f96a2c022de92c5bd9bbb.tar.gz bcm5719-llvm-35eaa55cfc8520d31e9f96a2c022de92c5bd9bbb.zip |
Loop exit sets are no longer explicitly held, they are dynamically computed on demand.
llvm-svn: 13046
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LICM.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 0bf94101d55..a02b66b20d6 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -436,7 +436,8 @@ bool LICM::isLoopInvariantInst(Instruction &I) { void LICM::sink(Instruction &I) { DEBUG(std::cerr << "LICM sinking instruction: " << I); - const std::vector<BasicBlock*> &ExitBlocks = CurLoop->getExitBlocks(); + std::vector<BasicBlock*> ExitBlocks; + CurLoop->getExitBlocks(ExitBlocks); if (isa<LoadInst>(I)) ++NumMovedLoads; else if (isa<CallInst>(I)) ++NumMovedCalls; @@ -593,7 +594,8 @@ bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) { return true; // Get the exit blocks for the current loop. - const std::vector<BasicBlock*> &ExitBlocks = CurLoop->getExitBlocks(); + std::vector<BasicBlock*> ExitBlocks; + CurLoop->getExitBlocks(ExitBlocks); // For each exit block, get the DT node and walk up the DT until the // instruction's basic block is found or we exit the loop. @@ -667,7 +669,8 @@ void LICM::PromoteValuesInLoop() { // std::set<BasicBlock*> ProcessedBlocks; - const std::vector<BasicBlock*> &ExitBlocks = CurLoop->getExitBlocks(); + std::vector<BasicBlock*> ExitBlocks; + CurLoop->getExitBlocks(ExitBlocks); for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) if (ProcessedBlocks.insert(ExitBlocks[i]).second) { // Copy all of the allocas into their memory locations... |