]> granicus.if.org Git - clang/commitdiff
Fix another major performance regression in LiveVariables by not canonicalizing the...
authorTed Kremenek <kremenek@apple.com>
Sun, 2 Oct 2011 01:45:37 +0000 (01:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 2 Oct 2011 01:45:37 +0000 (01:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140958 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LiveVariables.cpp

index 055b58ca81a5fb951e9f67dad11b8758e4c76115..be6e659bd99b5d8801e80d8cd13bf8e4413c7262 100644 (file)
@@ -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());  
 }