Many changes
* Simplify a lot of the inlining stuff. There are still problems, but not
many
* Break up the Function representation to have a vector for every different
node type so it is fast to find nodes of a particular flavor.
* Do more intelligent merging of call values
* Allow elimination of unreachable shadow and allocation nodes
* Generalize indistinguishability testing to allow merging of identical calls.
* Increase shadow node merging power
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2010 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/DataStructure/FunctionRepBuilder.cpp b/lib/Analysis/DataStructure/FunctionRepBuilder.cpp
index e2544c8..87d4a33 100644
--- a/lib/Analysis/DataStructure/FunctionRepBuilder.cpp
+++ b/lib/Analysis/DataStructure/FunctionRepBuilder.cpp
@@ -44,7 +44,7 @@
if (!Rep->ValueMap.count(V)) // Only process it once...
if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
GlobalDSNode *N = new GlobalDSNode(GV);
- Rep->Nodes.push_back(N);
+ Rep->GlobalNodes.push_back(N);
Rep->ValueMap[V].add(N);
Rep->addAllUsesToWorkList(GV);
@@ -60,7 +60,7 @@
//
void InitVisitor::visitCallInst(CallInst *CI) {
CallDSNode *C = new CallDSNode(CI);
- Rep->Nodes.push_back(C);
+ Rep->CallNodes.push_back(C);
Rep->CallMap[CI] = C;
if (isa<PointerType>(CI->getType())) {
@@ -95,8 +95,8 @@
// global vars...
//
void InitVisitor::visitAllocationInst(AllocationInst *AI) {
- NewDSNode *N = new NewDSNode(AI);
- Rep->Nodes.push_back(N);
+ AllocDSNode *N = new AllocDSNode(AI);
+ Rep->AllocNodes.push_back(N);
Rep->ValueMap[AI].add(N, AI);
@@ -144,7 +144,7 @@
// Only process arguments that are of pointer type...
if (isa<PointerType>((*I)->getType())) {
ArgDSNode *Arg = new ArgDSNode(*I);
- Nodes.push_back(Arg);
+ ArgNodes.push_back(Arg);
// Add a critical shadow value for it to represent what it is pointing
// to and add this to the value map...
@@ -326,10 +326,13 @@
//
FunctionDSGraph::FunctionDSGraph(Function *F) : Func(F) {
FunctionRepBuilder Builder(this);
- Nodes = Builder.getNodes();
+ ArgNodes = Builder.getArgNodes();
+ AllocNodes = Builder.getAllocNodes();
ShadowNodes = Builder.getShadowNodes();
- RetNode = Builder.getRetNode();
- ValueMap = Builder.getValueMap();
+ GlobalNodes = Builder.getGlobalNodes();
+ CallNodes = Builder.getCallNodes();
+ RetNode = Builder.getRetNode();
+ ValueMap = Builder.getValueMap();
bool Changed = true;
while (Changed) {