[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Feb 16 10:11:25 PST 2005
Changes in directory llvm-poolalloc/lib/PoolAllocate:
PointerCompress.cpp updated: 1.15 -> 1.16
---
Log message:
Handle values that have no correspondence to the original function.
Do not pointer compress functions that are pointer compreed clones of originals.
---
Diffs of the changes: (+10 -6)
PointerCompress.cpp | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.15 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.16
--- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.15 Wed Feb 16 11:44:25 2005
+++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Feb 16 12:11:12 2005
@@ -80,8 +80,8 @@
/// ClonedFunctionMap - Every time we clone a function to compress its
/// arguments, keep track of the clone and which arguments are compressed.
- std::map<std::pair<Function*, std::vector<unsigned> >,
- Function *> ClonedFunctionMap;
+ typedef std::pair<Function*, std::vector<unsigned> > CloneID;
+ std::map<CloneID, Function *> ClonedFunctionMap;
/// ClonedFunctionInfoMap - This identifies the pool allocated function that
/// a clone came from.
@@ -372,7 +372,8 @@
// If this is a pool allocator clone, map the value to the REAL original
// function.
if (!PAFuncInfo.NewToOldValueMap.empty())
- V = PAFuncInfo.MapValueToOriginal(V);
+ if ((V = PAFuncInfo.MapValueToOriginal(V)) == 0)
+ return 0; // Value didn't exist in the orig program (pool desc?)
DSNode *N = DSG.getNodeForValue(V).getNode();
return PoolInfo.count(N) ? N : 0;
@@ -901,7 +902,6 @@
// Recursively transform the function.
CompressPoolsInFunction(*Clone, &RemappedArgs);
- Clone->dump();
return Clone;
}
@@ -949,8 +949,12 @@
// Iterate over all functions in the module, looking for compressible data
// structures.
bool Changed = false;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- Changed |= CompressPoolsInFunction(*I);
+ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
+ // If this function is not a pointer-compressed clone, compress any pools in
+ // it now.
+ if (!ClonedFunctionInfoMap.count(I))
+ Changed |= CompressPoolsInFunction(*I);
+ }
ClonedFunctionMap.clear();
return Changed;
More information about the llvm-commits
mailing list