File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 64
64
#include " llvm/Support/Debug.h"
65
65
#include " llvm/Support/raw_ostream.h"
66
66
#include < algorithm>
67
+ #include " RewriteContext.h"
67
68
#include " RewriteSystem.h"
68
69
69
70
using namespace swift ;
@@ -681,8 +682,15 @@ void RewriteSystem::computeGeneratingConformances(
681
682
}
682
683
}
683
684
685
+ Context.ConformanceRulesHistogram .add (conformanceRules.size ());
686
+
684
687
computeCandidateConformancePaths (conformancePaths);
685
688
689
+ for (const auto &pair : conformancePaths) {
690
+ if (pair.second .size () > 1 )
691
+ Context.GeneratingConformancesHistogram .add (pair.second .size ());
692
+ }
693
+
686
694
if (Debug.contains (DebugFlags::GeneratingConformances)) {
687
695
llvm::dbgs () << " Initial set of equations:\n " ;
688
696
for (const auto &pair : conformancePaths) {
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ RewriteContext::RewriteContext(ASTContext &ctx)
59
59
RuleTrieHistogram(16 , /* Start=*/ 1 ),
60
60
RuleTrieRootHistogram(16 ),
61
61
PropertyTrieHistogram(16 , /* Start=*/ 1 ),
62
- PropertyTrieRootHistogram(16 ) {
62
+ PropertyTrieRootHistogram(16 ),
63
+ ConformanceRulesHistogram(16 ),
64
+ GeneratingConformancesHistogram(8 , /* Start=*/ 2 ) {
63
65
auto debugFlags = StringRef (ctx.LangOpts .DebugRequirementMachine );
64
66
if (!debugFlags.empty ())
65
67
Debug = parseDebugFlags (debugFlags);
@@ -683,6 +685,10 @@ RewriteContext::~RewriteContext() {
683
685
PropertyTrieHistogram.dump (llvm::dbgs ());
684
686
llvm::dbgs () << " \n * Property trie root fanout:\n " ;
685
687
PropertyTrieRootHistogram.dump (llvm::dbgs ());
688
+ llvm::dbgs () << " \n * Conformance rules:\n " ;
689
+ ConformanceRulesHistogram.dump (llvm::dbgs ());
690
+ llvm::dbgs () << " \n * Generating conformance equations:\n " ;
691
+ GeneratingConformancesHistogram.dump (llvm::dbgs ());
686
692
}
687
693
688
694
for (const auto &pair : Machines)
Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ class RewriteContext final {
130
130
Histogram RuleTrieRootHistogram;
131
131
Histogram PropertyTrieHistogram;
132
132
Histogram PropertyTrieRootHistogram;
133
+ Histogram ConformanceRulesHistogram;
134
+ Histogram GeneratingConformancesHistogram;
133
135
134
136
explicit RewriteContext (ASTContext &ctx);
135
137
You can’t perform that action at this time.
0 commit comments