[llvm-commits] [poolalloc] r116740 - in /poolalloc/trunk: include/poolalloc/PoolAllocate.h lib/PoolAllocate/PoolAllocate.cpp
John Criswell
criswell at uiuc.edu
Mon Oct 18 13:03:16 PDT 2010
Author: criswell
Date: Mon Oct 18 15:03:16 2010
New Revision: 116740
URL: http://llvm.org/viewvc/llvm-project?rev=116740&view=rev
Log:
Give different base names to global pools depending on whether they are for
global DSNode or local DSNodes that are created in main().
Modified:
poolalloc/trunk/include/poolalloc/PoolAllocate.h
poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=116740&r1=116739&r2=116740&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Mon Oct 18 15:03:16 2010
@@ -318,7 +318,7 @@
/// CreateGlobalPool - Create a global pool descriptor, initialize it in main,
/// and return a pointer to the global for it.
GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Alignment,
- Instruction *IPHint = 0);
+ std::string name = "GlobalPool", Instruction *IPHint = 0);
/// getPoolType - Return the type of a pool descriptor
/// FIXME: These constants should be chosen by the client
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=116740&r1=116739&r2=116740&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Oct 18 15:03:16 2010
@@ -971,7 +971,7 @@
Heuristic::OnePool &Pool = ResultPools[i];
Value *PoolDesc = Pool.PoolDesc;
if (PoolDesc == 0) {
- PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, InsertPt);
+ PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, "GlobalPool", InsertPt);
if (Pool.NodesInPool.size() == 1 &&
!Pool.NodesInPool[0]->isNodeCompletelyFolded())
@@ -997,11 +997,11 @@
/// poolinit for it into main. IPHint is an instruction that we should insert
/// the poolinit before if not null.
GlobalVariable *PoolAllocate::CreateGlobalPool(unsigned RecSize, unsigned Align,
- Instruction *IPHint) {
+ std::string name, Instruction *IPHint) {
GlobalVariable *GV =
new GlobalVariable(*CurModule,
PoolDescType, false, GlobalValue::InternalLinkage,
- ConstantAggregateZero::get(PoolDescType), "GlobalPool");
+ ConstantAggregateZero::get(PoolDescType), name);
// Update the global DSGraph to include this.
DSNode *GNode = Graphs->getGlobalsGraph()->addObjectToGraph(GV);
@@ -1072,7 +1072,7 @@
NewNode->setModifiedMarker()->setReadMarker(); // This is M/R
} else {
PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment,
- InsertPoint);
+ "PoolForMain", InsertPoint);
// Add the global node to main's graph.
DSNode *NewNode = DSG->addObjectToGraph(PoolDesc);
More information about the llvm-commits
mailing list