[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Apr 18 17:16:00 PDT 2004


Changes in directory llvm/lib/Transforms/Scalar:

LICM.cpp updated: 1.57 -> 1.58

---
Log message:

Loop exit sets are no longer explicitly held, they are dynamically computed on demand.



---
Diffs of the changes:  (+6 -3)

Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.57 llvm/lib/Transforms/Scalar/LICM.cpp:1.58
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.57	Sun Mar 14 22:11:30 2004
+++ llvm/lib/Transforms/Scalar/LICM.cpp	Sun Apr 18 17:15:13 2004
@@ -436,7 +436,8 @@
 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 @@
     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 @@
   //
   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...





More information about the llvm-commits mailing list