aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-27 21:56:55 +0000
committerChris Lattner <sabre@nondot.org>2005-03-27 21:56:55 +0000
commit40ee8ce28b6901cdb979030e580d32dcf732169a (patch)
tree93d2267697d0ce72d947cb8ece5cacd430b4b927 /lib/Analysis
parent267a1b02a2e0143c2b4bac11253f32fb1bf6fa7d (diff)
downloadexternal_llvm-40ee8ce28b6901cdb979030e580d32dcf732169a.zip
external_llvm-40ee8ce28b6901cdb979030e580d32dcf732169a.tar.gz
external_llvm-40ee8ce28b6901cdb979030e580d32dcf732169a.tar.bz2
speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DataStructure/Steensgaard.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp
index 0d63c64..aa7f54b 100644
--- a/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -124,7 +124,7 @@ bool Steens::runOnModule(Module &M) {
//
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal())
- ResultGraph->cloneInto(LDS.getDSGraph(*I));
+ ResultGraph->spliceFrom(LDS.getDSGraph(*I));
ResultGraph->removeTriviallyDeadNodes();
@@ -191,13 +191,18 @@ AliasAnalysis::AliasResult Steens::alias(const Value *V1, unsigned V1Size,
DSGraph::ScalarMapTy &GSM = ResultGraph->getScalarMap();
DSGraph::ScalarMapTy::iterator I = GSM.find(const_cast<Value*>(V1));
+ DSGraph::ScalarMapTy::iterator J = GSM.find(const_cast<Value*>(V2));
if (I != GSM.end() && !I->second.isNull() &&
- I->second.getNode()->isComplete()) {
+ J != GSM.end() && !J->second.isNull()) {
DSNodeHandle &V1H = I->second;
- DSGraph::ScalarMapTy::iterator J=GSM.find(const_cast<Value*>(V2));
- if (J != GSM.end() && !J->second.isNull() &&
+ DSNodeHandle &V2H = J->second;
+
+ // If at least one of the nodes is complete, we can say something about
+ // this. If one is complete and the other isn't, then they are obviously
+ // different nodes. If they are both complete, we can't say anything
+ // useful.
+ if (I->second.getNode()->isComplete() ||
J->second.getNode()->isComplete()) {
- DSNodeHandle &V2H = J->second;
// If the two pointers point to different data structure graph nodes, they
// cannot alias!
if (V1H.getNode() != V2H.getNode())