diff options
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/CallGraphSCCPass.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp index 4bb181e352d..ef61c65463f 100644 --- a/llvm/lib/Analysis/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp @@ -120,6 +120,7 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC, bool &DevirtualizedCall) { bool Changed = false; PMDataManager *PM = P->getAsPMDataManager(); + Module &M = CG.getModule(); if (!PM) { CallGraphSCCPass *CGSP = (CallGraphSCCPass*)P; @@ -130,7 +131,12 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC, { TimeRegion PassTimer(getPassTimer(CGSP)); + unsigned InstrCount = initSizeRemarkInfo(M); Changed = CGSP->runOnSCC(CurSCC); + + // If the pass modified the module, it may have modified the instruction + // count of the module. Try emitting a remark. + emitInstrCountChangedRemark(P, M, InstrCount); } // After the CGSCCPass is done, when assertions are enabled, use diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index 208bd53a3a8..00d88e8189e 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -151,6 +151,7 @@ void LPPassManager::markLoopAsDeleted(Loop &L) { bool LPPassManager::runOnFunction(Function &F) { auto &LIWP = getAnalysis<LoopInfoWrapperPass>(); LI = &LIWP.getLoopInfo(); + Module &M = *F.getParent(); #if 0 DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); #endif @@ -200,8 +201,9 @@ bool LPPassManager::runOnFunction(Function &F) { { PassManagerPrettyStackEntry X(P, *CurrentLoop->getHeader()); TimeRegion PassTimer(getPassTimer(P)); - + unsigned InstrCount = initSizeRemarkInfo(M); Changed |= P->runOnLoop(CurrentLoop, *this); + emitInstrCountChangedRemark(P, M, InstrCount); } if (Changed) |