summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/LiveVariables.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-10-02 01:45:37 +0000
committerTed Kremenek <kremenek@apple.com>2011-10-02 01:45:37 +0000
commitc8f008ac313c9e4da0a985d1fd7854f7a218ed12 (patch)
tree0016c1e884ed85582c72ab8f9565e0175bb04c44 /clang/lib/Analysis/LiveVariables.cpp
parent9b0a7cea0f5bb2d3197ff33734cc5411ea793e10 (diff)
downloadbcm5719-llvm-c8f008ac313c9e4da0a985d1fd7854f7a218ed12.tar.gz
bcm5719-llvm-c8f008ac313c9e4da0a985d1fd7854f7a218ed12.zip
Fix another major performance regression in LiveVariables by not canonicalizing the underlying ImmutableSets on every analyzed statement (just at merges). Fixes <rdar://problem/10087538>.
llvm-svn: 140958
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r--clang/lib/Analysis/LiveVariables.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp
index 055b58ca81a..be6e659bd99 100644
--- a/clang/lib/Analysis/LiveVariables.cpp
+++ b/clang/lib/Analysis/LiveVariables.cpp
@@ -205,7 +205,10 @@ public:
void dumpBlockLiveness(const SourceManager& M);
LiveVariablesImpl(AnalysisContext &ac, bool KillAtAssign)
- : analysisContext(ac), killAtAssign(KillAtAssign) {}
+ : analysisContext(ac),
+ SSetFact(false), // Do not canonicalize ImmutableSets by default.
+ DSetFact(false), // This is a *major* performance win.
+ killAtAssign(KillAtAssign) {}
};
}
@@ -255,6 +258,8 @@ LiveVariablesImpl::merge(LiveVariables::LivenessValues valsA,
SSetRefA = mergeSets(SSetRefA, SSetRefB);
DSetRefA = mergeSets(DSetRefA, DSetRefB);
+ // asImmutableSet() canonicalizes the tree, allowing us to do an easy
+ // comparison afterwards.
return LiveVariables::LivenessValues(SSetRefA.asImmutableSet(),
DSetRefA.asImmutableSet());
}
OpenPOWER on IntegriCloud