From a0aa5b35e7270973b113c9f3620ce6a1f174f2d6 Mon Sep 17 00:00:00 2001 From: Jessica Paquette Date: Thu, 6 Sep 2018 21:19:54 +0000 Subject: Output per-function size-info remarks This patch adds per-function size information remarks. Previously, passing -Rpass-analysis=size-info would only give you per-module changes. By adding the ability to do this per-function, it's easier to see which functions contributed the most to size changes. https://reviews.llvm.org/D51467 llvm-svn: 341588 --- llvm/lib/Analysis/LoopPass.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/LoopPass.cpp') diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index 3629ae90da5..4c1bd7ab08e 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -195,10 +195,11 @@ bool LPPassManager::runOnFunction(Function &F) { // Walk Loops unsigned InstrCount, FunctionSize = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); // Collect the initial size of the module and the function we're looking at. if (EmitICRemark) { - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); FunctionSize = F.getInstructionCount(); } while (!LQ.empty()) { @@ -226,7 +227,8 @@ bool LPPassManager::runOnFunction(Function &F) { if (NewSize != FunctionSize) { int64_t Delta = static_cast(NewSize) - static_cast(FunctionSize); - emitInstrCountChangedRemark(P, M, Delta, InstrCount, &F); + emitInstrCountChangedRemark(P, M, Delta, InstrCount, + FunctionToInstrCount, &F); InstrCount = static_cast(InstrCount) + Delta; FunctionSize = NewSize; } -- cgit v1.2.3