From 1120c8b34ada1f7ce103f617a0dfa4526bf9e207 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 28 Mar 2002 17:56:03 +0000 Subject: 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 --- lib/Analysis/DataStructure/FunctionRepBuilder.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/Analysis/DataStructure/FunctionRepBuilder.cpp') 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(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(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((*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) { -- cgit v1.2.3-18-g5258