aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2021-03-31 23:23:57 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2021-03-31 23:27:36 +0300
commit43ded90094f761a4763497773e722c196c69d17e (patch)
tree70d6d97e911d6a6334e3b5e242faa7009e402622 /llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
parente8d8754c063c2bd3861bf0570012c827ee58e747 (diff)
downloadllvm-43ded90094f761a4763497773e722c196c69d17e.zip
llvm-43ded90094f761a4763497773e722c196c69d17e.tar.gz
llvm-43ded90094f761a4763497773e722c196c69d17e.tar.bz2
[NFC][LoopRotation] Count the number of instructions hoisted/cloned into preheader
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopRotationUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopRotationUtils.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
index 2c68e4b..200993f 100644
--- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
@@ -46,6 +46,10 @@ using namespace llvm;
STATISTIC(NumNotRotatedDueToHeaderSize,
"Number of loops not rotated due to the header size");
+STATISTIC(NumInstrsHoisted,
+ "Number of instructions hoisted into loop preheader");
+STATISTIC(NumInstrsDuplicated,
+ "Number of instructions cloned into loop preheader");
STATISTIC(NumRotated, "Number of loops rotated");
static cl::opt<bool>
@@ -424,11 +428,13 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
!Inst->mayWriteToMemory() && !Inst->isTerminator() &&
!isa<DbgInfoIntrinsic>(Inst) && !isa<AllocaInst>(Inst)) {
Inst->moveBefore(LoopEntryBranch);
+ ++NumInstrsHoisted;
continue;
}
// Otherwise, create a duplicate of the instruction.
Instruction *C = Inst->clone();
+ ++NumInstrsDuplicated;
// Eagerly remap the operands of the instruction.
RemapInstruction(C, ValueMap,