summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
authorXin Tong <trent.xin.tong@gmail.com>2018-07-22 05:27:41 +0000
committerXin Tong <trent.xin.tong@gmail.com>2018-07-22 05:27:41 +0000
commit023e25ad14e529be304136b127c7be19d13dfe9b (patch)
tree88e673b957b3d46966d1e621df87bb383c165e75 /llvm/lib/Analysis/LoopPass.cpp
parentcc4ad95c303daf27ba3a1815eb81b2c832383ba2 (diff)
downloadbcm5719-llvm-023e25ad14e529be304136b127c7be19d13dfe9b.tar.gz
bcm5719-llvm-023e25ad14e529be304136b127c7be19d13dfe9b.zip
[ORE] Move loop invariant ORE checks outside the PM loop.
Summary: This takes 22ms out of ~20s compiling sqlite3.c because we call it for every unit of compilation and every pass. Reviewers: paquette, anemet Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D49586 llvm-svn: 337654
Diffstat (limited to 'llvm/lib/Analysis/LoopPass.cpp')
-rw-r--r--llvm/lib/Analysis/LoopPass.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index c5ced03cfa8..07a151ce0fc 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -193,6 +193,8 @@ bool LPPassManager::runOnFunction(Function &F) {
}
// Walk Loops
+ unsigned InstrCount = 0;
+ bool EmitICRemark = M.shouldEmitInstrCountChangedRemark();
while (!LQ.empty()) {
CurrentLoopDeleted = false;
CurrentLoop = LQ.back();
@@ -210,9 +212,11 @@ bool LPPassManager::runOnFunction(Function &F) {
{
PassManagerPrettyStackEntry X(P, *CurrentLoop->getHeader());
TimeRegion PassTimer(getPassTimer(P));
- unsigned InstrCount = initSizeRemarkInfo(M);
+ if (EmitICRemark)
+ InstrCount = initSizeRemarkInfo(M);
Changed |= P->runOnLoop(CurrentLoop, *this);
- emitInstrCountChangedRemark(P, M, InstrCount);
+ if (EmitICRemark)
+ emitInstrCountChangedRemark(P, M, InstrCount);
}
if (Changed)
OpenPOWER on IntegriCloud