[llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Nov 13 11:12:08 PST 2003


Changes in directory poolalloc/lib/PoolAllocate:

PoolAllocate.cpp updated: 1.48 -> 1.49

---
Log message:

Fix the -poolalloc-force-simple-pool-init to work right, fixing voronoi!


---
Diffs of the changes:  (+14 -7)

Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.48 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.49
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.48	Wed Nov 12 19:43:48 2003
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Thu Nov 13 11:10:58 2003
@@ -666,7 +666,8 @@
     PoolInitPoints.push_back(InsertPoint);
 
     for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-      if (isa<ReturnInst>(BB->getTerminator()))
+      if (isa<ReturnInst>(BB->getTerminator()) ||
+          isa<UnwindInst>(BB->getTerminator()))
         PoolDestroyPoints.push_back(BB->getTerminator());
   }
 
@@ -738,7 +739,8 @@
           while (!PoolUses.count(std::make_pair(PD, It)))
             // Advance past non-users deleting any pool frees that we run across
             DeleteIfIsPoolFree(It++, PD, PoolFrees);
-          PoolInitPoints.push_back(It);
+          if (!DisableInitDestroyOpt)
+            PoolInitPoints.push_back(It);
           PoolInitInsertedBlocks.insert(BB);
         }
       } else if (!AllIn) {
@@ -750,7 +752,8 @@
               goto TryAgainPred;
 
             // Insert at the end of the predecessor, before the terminator.
-            PoolInitPoints.push_back((*PI)->getTerminator());
+            if (!DisableInitDestroyOpt)
+              PoolInitPoints.push_back((*PI)->getTerminator());
             PoolInitInsertedBlocks.insert(*PI);
           }
       }
@@ -770,7 +773,8 @@
             DeleteIfIsPoolFree(It--, PD, PoolFrees);
 
           // Insert after the first using instruction
-          PoolDestroyPoints.push_back(++It);
+          if (!DisableInitDestroyOpt)
+            PoolDestroyPoints.push_back(++It);
           PoolDestroyInsertedBlocks.insert(BB);
         }
       } else if (!AllIn) {
@@ -782,7 +786,8 @@
             // Insert at entry to the successor, but after any PHI nodes.
             BasicBlock::iterator It = (*SI)->begin();
             while (isa<PHINode>(It)) ++It;
-            PoolDestroyPoints.push_back(It);
+            if (!DisableInitDestroyOpt)
+              PoolDestroyPoints.push_back(It);
             PoolDestroyInsertedBlocks.insert(*SI);
           }
       }
@@ -795,7 +800,8 @@
                    PoolInitPoints[i]);
       DEBUG(std::cerr << PoolInitPoints[i]->getParent()->getName() << " ");
     }
-    PoolInitPoints.clear();
+    if (!DisableInitDestroyOpt)
+      PoolInitPoints.clear();
 
     DEBUG(std::cerr << "\n  Destroy in blocks: ");
 
@@ -816,7 +822,8 @@
       CalculateLivePoolFreeBlocks(PoolFreeLiveBlocks, PD);
     else
       PoolFreeLiveBlocks = LiveBlocks;
-    PoolDestroyPoints.clear();
+    if (!DisableInitDestroyOpt)
+      PoolDestroyPoints.clear();
 
     // Delete any pool frees which are not in live blocks, for correctness.
     std::set<std::pair<AllocaInst*, CallInst*> >::iterator PFI =





More information about the llvm-commits mailing list