summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-09-06 21:19:54 +0000
committerJessica Paquette <jpaquette@apple.com>2018-09-06 21:19:54 +0000
commita0aa5b35e7270973b113c9f3620ce6a1f174f2d6 (patch)
tree4f04f8c9617236742a16b0c8f57ba7fcb9a55335 /llvm/lib/Analysis/CallGraphSCCPass.cpp
parentb23648cfdb5add073e968d76061b9e78f9cd2f10 (diff)
downloadbcm5719-llvm-a0aa5b35e7270973b113c9f3620ce6a1f174f2d6.tar.gz
bcm5719-llvm-a0aa5b35e7270973b113c9f3620ce6a1f174f2d6.zip
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
Diffstat (limited to 'llvm/lib/Analysis/CallGraphSCCPass.cpp')
-rw-r--r--llvm/lib/Analysis/CallGraphSCCPass.cpp6
1 files changed, 4 insertions, 2 deletions
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<std::pair<unsigned, unsigned>> 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<int64_t>(SCCCount) - static_cast<int64_t>(InstrCount);
- emitInstrCountChangedRemark(P, M, Delta, InstrCount);
+ emitInstrCountChangedRemark(P, M, Delta, InstrCount,
+ FunctionToInstrCount);
InstrCount = SCCCount;
}
}
OpenPOWER on IntegriCloud