diff options
author | Jessica Paquette <jpaquette@apple.com> | 2018-09-06 21:19:54 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2018-09-06 21:19:54 +0000 |
commit | a0aa5b35e7270973b113c9f3620ce6a1f174f2d6 (patch) | |
tree | 4f04f8c9617236742a16b0c8f57ba7fcb9a55335 /llvm/lib/Analysis/LoopPass.cpp | |
parent | b23648cfdb5add073e968d76061b9e78f9cd2f10 (diff) | |
download | bcm5719-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/LoopPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<std::pair<unsigned, unsigned>> 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<int64_t>(NewSize) - static_cast<int64_t>(FunctionSize); - emitInstrCountChangedRemark(P, M, Delta, InstrCount, &F); + emitInstrCountChangedRemark(P, M, Delta, InstrCount, + FunctionToInstrCount, &F); InstrCount = static_cast<int64_t>(InstrCount) + Delta; FunctionSize = NewSize; } |