forked from OSchip/llvm-project
[NFC][LoopDeletion] Count the number of broken backedges
Those don't contribute to the number of deleted loops.
This commit is contained in:
parent
35f42340a2
commit
0ae7bf124a
|
@ -36,6 +36,8 @@ using namespace llvm;
|
|||
#define DEBUG_TYPE "loop-delete"
|
||||
|
||||
STATISTIC(NumDeleted, "Number of loops deleted");
|
||||
STATISTIC(NumBackedgesBroken,
|
||||
"Number of loops for which we managed to break the backedge");
|
||||
|
||||
static cl::opt<bool> EnableSymbolicExecution(
|
||||
"loop-deletion-enable-symbolic-execution", cl::Hidden, cl::init(true),
|
||||
|
@ -409,6 +411,7 @@ breakBackedgeIfNotTaken(Loop *L, DominatorTree &DT, ScalarEvolution &SE,
|
|||
if (BTC->isZero()) {
|
||||
// SCEV knows this backedge isn't taken!
|
||||
breakLoopBackedge(L, DT, SE, LI, MSSA);
|
||||
++NumBackedgesBroken;
|
||||
return LoopDeletionResult::Deleted;
|
||||
}
|
||||
|
||||
|
@ -418,6 +421,7 @@ breakBackedgeIfNotTaken(Loop *L, DominatorTree &DT, ScalarEvolution &SE,
|
|||
if (isa<SCEVCouldNotCompute>(BTC) || !SE.isKnownNonZero(BTC))
|
||||
if (canProveExitOnFirstIteration(L, DT, LI)) {
|
||||
breakLoopBackedge(L, DT, SE, LI, MSSA);
|
||||
++NumBackedgesBroken;
|
||||
return LoopDeletionResult::Deleted;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue