[llvm-commits] CVS: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Oct 31 09:47:58 PST 2004
Changes in directory poolalloc/lib/PoolAllocate:
EquivClassGraphs.cpp updated: 1.4 -> 1.5
---
Log message:
Only call getNodeForValue on pointer arguments! this fixes a problem running
on Prolangs-C++/objects
---
Diffs of the changes: (+11 -5)
Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp
diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.4 poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.5
--- poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.4 Tue Oct 12 11:52:09 2004
+++ poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp Sun Oct 31 11:47:48 2004
@@ -181,6 +181,7 @@
EqEnd = EqClass.end(); EqI != EqEnd; ++EqI) {
Function* F = *EqI;
DSGraph*& FG = FoldedGraphsMap[F];
+
if (F == LF || FG == mergedG)
continue;
@@ -194,6 +195,7 @@
GraphsMerged.insert(CBUGraph);
DSGraph::NodeMapTy NodeMap;
+
mergedG->cloneInto(*CBUGraph, mergedG->getScalarMap(),
mergedG->getReturnNodes(), NodeMap, 0);
@@ -204,10 +206,14 @@
// If there are extra function args, add them to the vector of argNodes
Function::aiterator AI2 = F->abegin(), AI2end = F->aend();
for (unsigned arg=0, numArgs=GraphInfo.argNodes.size();
- arg < numArgs && AI2 != AI2end; ++AI2, ++arg)
- GraphInfo.argNodes[arg].mergeWith(mergedG->getNodeForValue(AI2));
+ arg != numArgs && AI2 != AI2end; ++AI2, ++arg)
+ if (DS::isPointerType(AI2->getType()))
+ GraphInfo.argNodes[arg].mergeWith(mergedG->getNodeForValue(AI2));
+
for ( ; AI2 != AI2end; ++AI2)
- GraphInfo.argNodes.push_back(mergedG->getNodeForValue(AI2));
+ if (DS::isPointerType(AI2->getType()))
+ GraphInfo.argNodes.push_back(mergedG->getNodeForValue(AI2));
+ DEBUG(mergedG->AssertGraphOK());
}
}
}
@@ -223,7 +229,6 @@
// Use the CBU graph directly without copying it.
// This automatically updates the FoldedGraphsMap via the reference.
Graph = &CBU->getDSGraph(F);
-
return *Graph;
}
@@ -306,6 +311,7 @@
FG.removeTriviallyDeadNodes();
Stack.pop_back();
+
processGraph(FG, F);
ValMap[&F] = ~0U;
return MyID;
@@ -319,7 +325,7 @@
hash_set<Instruction*> calls;
- DSGraph* CallerGraph = sameAsCBUGraph(F)? NULL : &getOrCreateGraph(F);
+ DSGraph* CallerGraph = sameAsCBUGraph(F) ? NULL : &getOrCreateGraph(F);
// If the function has not yet been cloned, let's check if any callees
// need to be inlined before cloning it.
More information about the llvm-commits
mailing list