16#include "llvm/ADT/Statistic.h"
17#include "llvm/IR/DebugLoc.h"
18#include "llvm/Support/Debug.h"
19#include "llvm/Support/raw_ostream.h"
25#define DEBUG_TYPE "polly-prune-unprofitable"
30 "Number of SCoPs considered for unprofitability pruning");
31STATISTIC(ScopsPruned,
"Number of pruned SCoPs because it they cannot be "
32 "optimized in a significant way");
33STATISTIC(ScopsSurvived,
"Number of SCoPs after pruning");
35STATISTIC(NumPrunedLoops,
"Number of pruned loops");
36STATISTIC(NumPrunedBoxedLoops,
"Number of pruned boxed loops");
37STATISTIC(NumPrunedAffineLoops,
"Number of pruned affine loops");
39STATISTIC(NumLoopsInScop,
"Number of loops in scops after pruning");
40STATISTIC(NumBoxedLoops,
"Number of boxed loops in SCoPs after pruning");
41STATISTIC(NumAffineLoops,
"Number of affine loops in SCoPs after pruning");
43static void updateStatistics(
Scop &
S,
bool Pruned) {
62 dbgs() <<
"NOTE: -polly-process-unprofitable active, won't prune "
69 if (!
S.isProfitable(
true)) {
71 dbgs() <<
"SCoP pruned because it probably cannot be optimized in "
72 "a significant way\n");
74 updateStatistics(
S,
true);
76 updateStatistics(
S,
false);
STATISTIC(ScopFound, "Number of valid Scops")
bool runPruneUnprofitable(Scop &S)
bool PollyProcessUnprofitable