mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-05 00:49:43 +00:00
[ScopDetection] Add stat for total number of loops.
The total number of loops is useful as a baseline comparing how many loops have been optimized in different configurations. llvm-svn: 311469
This commit is contained in:
parent
9cbbacb910
commit
5b228bbb12
@ -212,6 +212,8 @@ StringRef polly::PollySkipFnAttr = "polly.skip.fn";
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Statistics.
|
||||
|
||||
STATISTIC(NumTotalLoops, "Number of loops (in- or out of scops, in any "
|
||||
"function processed by Polly)");
|
||||
STATISTIC(NumScopRegions, "Number of scops");
|
||||
STATISTIC(NumLoopsInScop, "Number of loops in scops");
|
||||
STATISTIC(NumScopsDepthOne, "Number of scops with maximal loop depth 1");
|
||||
@ -303,6 +305,17 @@ static bool doesStringMatchAnyRegex(StringRef Str,
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ScopDetection.
|
||||
|
||||
static void countTotalLoops(Loop *L) {
|
||||
NumTotalLoops++;
|
||||
for (Loop *SubLoop : L->getSubLoops())
|
||||
countTotalLoops(SubLoop);
|
||||
}
|
||||
|
||||
static void countTotalLoops(LoopInfo &LI) {
|
||||
for (Loop *L : LI)
|
||||
countTotalLoops(L);
|
||||
}
|
||||
|
||||
ScopDetection::ScopDetection(Function &F, const DominatorTree &DT,
|
||||
ScalarEvolution &SE, LoopInfo &LI, RegionInfo &RI,
|
||||
AliasAnalysis &AA, OptimizationRemarkEmitter &ORE)
|
||||
@ -325,6 +338,7 @@ ScopDetection::ScopDetection(Function &F, const DominatorTree &DT,
|
||||
|
||||
findScops(*TopRegion);
|
||||
|
||||
countTotalLoops(LI);
|
||||
NumScopRegions += ValidRegions.size();
|
||||
|
||||
// Prune non-profitable regions.
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
; REQUIRES: asserts
|
||||
|
||||
; CHECK-DAG: 10 polly-detect - Number of loops (in- or out of scops, in any function processed by Polly)
|
||||
; CHECK-DAG: 4 polly-detect - Maximal number of loops in scops (profitable scops only)
|
||||
; CHECK-DAG: 4 polly-detect - Maximal number of loops in scops
|
||||
; CHECK-DAG: 10 polly-detect - Number of loops in scops (profitable scops only)
|
||||
|
Loading…
x
Reference in New Issue
Block a user