diff options
author | Michael Kruse <llvm@meinersbur.de> | 2017-08-23 13:50:30 +0000 |
---|---|---|
committer | Michael Kruse <llvm@meinersbur.de> | 2017-08-23 13:50:30 +0000 |
commit | 06ed529205634a55e246a8123673de3ce4b79139 (patch) | |
tree | 215619888d5c1f27f1331b4aaad6ad6c789da6b0 /polly/lib/CodeGen/CodeGeneration.cpp | |
parent | 5e7071f5d70c77c1ab36014254f0217f8e0353bc (diff) | |
download | bcm5719-llvm-06ed529205634a55e246a8123673de3ce4b79139.tar.gz bcm5719-llvm-06ed529205634a55e246a8123673de3ce4b79139.zip |
Add more statistics.
Add statistics about
- Which optimizations are applied
- Number of loops in Scops at various stages
- Number of scalar/singleton writes at various stages representative
for scalar false dependencies
- Number of parallel loops
These will be useful to find regressions due to moving Polly further
down of LLVM's pass pipeline.
Differential Revision: https://reviews.llvm.org/D37049
llvm-svn: 311553
Diffstat (limited to 'polly/lib/CodeGen/CodeGeneration.cpp')
-rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index d362ffbfaf1..2cbab749c4b 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -56,6 +56,13 @@ static cl::opt<bool, true> cl::location(polly::PerfMonitoring), cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); +STATISTIC(ScopsProcessed, "Number of SCoP processed"); +STATISTIC(CodegenedScops, "Number of successfully generated SCoPs"); +STATISTIC(CodegenedAffineLoops, + "Number of original affine loops in SCoPs that have been generated"); +STATISTIC(CodegenedBoxedLoops, + "Number of original boxed loops in SCoPs that have been generated"); + namespace polly { /// Mark a basic block unreachable. /// @@ -162,6 +169,11 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT, if (!AstRoot) return false; + // Collect statistics. Do it before we modify the IR to avoid having it any + // influence on the result. + auto ScopStats = S.getStatistics(); + ScopsProcessed++; + auto &DL = S.getFunction().getParent()->getDataLayout(); Region *R = &S.getRegion(); assert(!R->isTopLevelRegion() && "Top level regions are not supported"); @@ -249,6 +261,10 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT, NodeBuilder.create(AstRoot); NodeBuilder.finalize(); fixRegionInfo(*EnteringBB->getParent(), *R->getParent(), RI); + + CodegenedScops++; + CodegenedAffineLoops += ScopStats.NumAffineLoops; + CodegenedBoxedLoops += ScopStats.NumBoxedLoops; } Function *F = EnteringBB->getParent(); |