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/CallGraphSCCPass.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/CallGraphSCCPass.cpp') diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp index 24dbda05f4b..3e9226f91de 100644 --- a/llvm/lib/Analysis/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp @@ -132,10 +132,11 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC, { unsigned InstrCount, SCCCount = 0; + StringMap> FunctionToInstrCount; bool EmitICRemark = M.shouldEmitInstrCountChangedRemark(); TimeRegion PassTimer(getPassTimer(CGSP)); if (EmitICRemark) - InstrCount = initSizeRemarkInfo(M); + InstrCount = initSizeRemarkInfo(M, FunctionToInstrCount); Changed = CGSP->runOnSCC(CurSCC); if (EmitICRemark) { @@ -146,7 +147,8 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC, // Yep. Emit a remark and update InstrCount. int64_t Delta = static_cast(SCCCount) - static_cast(InstrCount); - emitInstrCountChangedRemark(P, M, Delta, InstrCount); + emitInstrCountChangedRemark(P, M, Delta, InstrCount, + FunctionToInstrCount); InstrCount = SCCCount; } } -- cgit v1.2.3