Skip to content

Commit 43ded90

Browse files
committed
[NFC][LoopRotation] Count the number of instructions hoisted/cloned into preheader
1 parent e8d8754 commit 43ded90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Transforms/Utils/LoopRotationUtils.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ using namespace llvm;
4646

4747
STATISTIC(NumNotRotatedDueToHeaderSize,
4848
"Number of loops not rotated due to the header size");
49+
STATISTIC(NumInstrsHoisted,
50+
"Number of instructions hoisted into loop preheader");
51+
STATISTIC(NumInstrsDuplicated,
52+
"Number of instructions cloned into loop preheader");
4953
STATISTIC(NumRotated, "Number of loops rotated");
5054

5155
static cl::opt<bool>
@@ -424,11 +428,13 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
424428
!Inst->mayWriteToMemory() && !Inst->isTerminator() &&
425429
!isa<DbgInfoIntrinsic>(Inst) && !isa<AllocaInst>(Inst)) {
426430
Inst->moveBefore(LoopEntryBranch);
431+
++NumInstrsHoisted;
427432
continue;
428433
}
429434

430435
// Otherwise, create a duplicate of the instruction.
431436
Instruction *C = Inst->clone();
437+
++NumInstrsDuplicated;
432438

433439
// Eagerly remap the operands of the instruction.
434440
RemapInstruction(C, ValueMap,

0 commit comments

Comments
 (0)