summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-08-31 20:20:56 +0000
committerJessica Paquette <jpaquette@apple.com>2018-08-31 20:20:56 +0000
commit1fc443b8877e16c145a73158ed68def18f9f1f6a (patch)
tree451e6962ebf124316a92eb411ef09efb72df847d /llvm/lib/Analysis/CallGraphSCCPass.cpp
parent454d1032e90e7510c6902c957663b76c4ad8563a (diff)
downloadbcm5719-llvm-1fc443b8877e16c145a73158ed68def18f9f1f6a.tar.gz
bcm5719-llvm-1fc443b8877e16c145a73158ed68def18f9f1f6a.zip
[NFC] Pre-calculate SCC IR counts in size remarks.
Same vein as the previous commits. Pre-calculate the size of the module and use that to decide if we're going to emit a remark. This one comes with a FIXME and TODO. First off, CallGraphSCC and CallGraphNode don't have a getInstructionCount function. So, for now, we do the same thing as in a module pass. Second off, we're not really saving anything here yet, because as before, I need to change emitInstrCountChangedRemark to take in a delta. Keeping the patches small though, so that's coming up next. 5/6 llvm-svn: 341249
Diffstat (limited to 'llvm/lib/Analysis/CallGraphSCCPass.cpp')
-rw-r--r--llvm/lib/Analysis/CallGraphSCCPass.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index df652552bd6..d090b5afd2e 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -131,17 +131,25 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC,
}
{
- unsigned InstrCount = 0;
+ unsigned InstrCount, SCCCount = 0;
bool EmitICRemark = M.shouldEmitInstrCountChangedRemark();
TimeRegion PassTimer(getPassTimer(CGSP));
if (EmitICRemark)
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.
- if (EmitICRemark)
- emitInstrCountChangedRemark(P, M, InstrCount);
+ if (EmitICRemark) {
+ // FIXME: Add getInstructionCount to CallGraphSCC.
+ // TODO: emitInstrCountChangedRemark should take in the delta between
+ // SCCount and InstrCount.
+ SCCCount = M.getInstructionCount();
+ // Is there a difference in the number of instructions in the module?
+ if (SCCCount != InstrCount) {
+ // Yep. Emit a remark and update InstrCount.
+ emitInstrCountChangedRemark(P, M, InstrCount);
+ InstrCount = SCCCount;
+ }
+ }
}
// After the CGSCCPass is done, when assertions are enabled, use
OpenPOWER on IntegriCloud