aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-18 22:15:13 +0000
committerChris Lattner <sabre@nondot.org>2004-04-18 22:15:13 +0000
commit5fa802fe279f10f402e039bc931aa57c0e424bf5 (patch)
treec95c3817c368ad75e13fd6b6536e8e5926665ffb /lib/Transforms/Scalar
parentf1ab4b4eac5603d19c20f4a508f93a118a52bdd5 (diff)
downloadexternal_llvm-5fa802fe279f10f402e039bc931aa57c0e424bf5.zip
external_llvm-5fa802fe279f10f402e039bc931aa57c0e424bf5.tar.gz
external_llvm-5fa802fe279f10f402e039bc931aa57c0e424bf5.tar.bz2
Loop exit sets are no longer explicitly held, they are dynamically computed on demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 0bf9410..a02b66b 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/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...