diff options
author | Chris Lattner <sabre@nondot.org> | 2002-03-28 17:56:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-03-28 17:56:03 +0000 |
commit | 1120c8b34ada1f7ce103f617a0dfa4526bf9e207 (patch) | |
tree | bf50db8005a275bcf7d65a8e90a6ae80154be8b2 /lib/Analysis/DataStructure/FunctionRepBuilder.cpp | |
parent | 1d8ec6194a3c8d6e676f373af04171e5ad2ed4eb (diff) |
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
Diffstat (limited to 'lib/Analysis/DataStructure/FunctionRepBuilder.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/FunctionRepBuilder.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Analysis/DataStructure/FunctionRepBuilder.cpp b/lib/Analysis/DataStructure/FunctionRepBuilder.cpp index e2544c82dc..87d4a332ce 100644 --- a/lib/Analysis/DataStructure/FunctionRepBuilder.cpp +++ b/lib/Analysis/DataStructure/FunctionRepBuilder.cpp @@ -44,7 +44,7 @@ void InitVisitor::visitOperand(Value *V) { 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::visitOperand(Value *V) { // 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 @@ void InitVisitor::visitCallInst(CallInst *CI) { // 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 @@ void FunctionRepBuilder::initializeWorkList(Function *Func) { // 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 @@ void FunctionRepBuilder::visitPHINode(PHINode *PN) { // 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) { |