aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-02 04:39:13 +0000
committerChris Lattner <sabre@nondot.org>2003-07-02 04:39:13 +0000
commit0b61cdd191f274d8067fa9587468da4ac7626d1a (patch)
tree6bf6c1c8e1413bc38a07473c71da86114dcde623 /llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
parent03f3cb1af7c32340abce302dc16c7213ba77fbf7 (diff)
downloadllvm-0b61cdd191f274d8067fa9587468da4ac7626d1a.zip
llvm-0b61cdd191f274d8067fa9587468da4ac7626d1a.tar.gz
llvm-0b61cdd191f274d8067fa9587468da4ac7626d1a.tar.bz2
Reduce amount of work we do calculating mustaliases if the arg is a global
llvm-svn: 7062
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructureAA.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructureAA.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
index bb28389..4940e9d 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
@@ -146,17 +146,22 @@ AliasAnalysis::AliasResult DSAA::alias(const Value *V1, unsigned V1Size,
/// specified vector.
///
void DSAA::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
- DSGraph *G = getGraphForValue(P);
- if (!G) G = &TD->getGlobalsGraph();
-
- // The only must alias information we can currently determine occurs when the
- // node for P is a global node with only one entry.
- const DSGraph::ScalarMapTy &GSM = G->getScalarMap();
- DSGraph::ScalarMapTy::const_iterator I = GSM.find(P);
- if (I != GSM.end()) {
- DSNode *N = I->second.getNode();
- if (isSinglePhysicalObject(N))
- RetVals.push_back(N->getGlobals()[0]);
+ // Currently the only must alias information we can provide is to say that
+ // something is equal to a global value. If we already have a global value,
+ // don't get worked up about it.
+ if (!isa<GlobalValue>(P)) {
+ DSGraph *G = getGraphForValue(P);
+ if (!G) G = &TD->getGlobalsGraph();
+
+ // The only must alias information we can currently determine occurs when
+ // the node for P is a global node with only one entry.
+ const DSGraph::ScalarMapTy &GSM = G->getScalarMap();
+ DSGraph::ScalarMapTy::const_iterator I = GSM.find(P);
+ if (I != GSM.end()) {
+ DSNode *N = I->second.getNode();
+ if (N->isComplete() && isSinglePhysicalObject(N))
+ RetVals.push_back(N->getGlobals()[0]);
+ }
}
return getAnalysis<AliasAnalysis>().getMustAliases(P, RetVals);