diff options
author | Jessica Paquette <jpaquette@apple.com> | 2018-08-31 20:20:57 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2018-08-31 20:20:57 +0000 |
commit | 9a23c5592083384aea3494882170488e30138f36 (patch) | |
tree | 5ee9708b0c21ad3686c6967c6365ad6f7485cf12 /llvm/lib/Analysis/CallGraphSCCPass.cpp | |
parent | 1fc443b8877e16c145a73158ed68def18f9f1f6a (diff) | |
download | bcm5719-llvm-9a23c5592083384aea3494882170488e30138f36.tar.gz bcm5719-llvm-9a23c5592083384aea3494882170488e30138f36.zip |
[NFC] Pass the instruction delta to emitInstrCountChangedRemark
Instead of counting the size of the entire module every time we run a pass,
pass along a delta instead and use that to emit the remark.
This means we only have to use (on average) smaller IR units to calculate
instruction counts. E.g, in a BB pass, we only need to look at the delta of
the BB instead of the delta of the entire module.
6/6
(This improved compile time for size remarks on sqlite3 + O2 significantly)
llvm-svn: 341250
Diffstat (limited to 'llvm/lib/Analysis/CallGraphSCCPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/CallGraphSCCPass.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp index d090b5afd2e..24dbda05f4b 100644 --- a/llvm/lib/Analysis/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp @@ -124,7 +124,7 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC, Module &M = CG.getModule(); if (!PM) { - CallGraphSCCPass *CGSP = (CallGraphSCCPass*)P; + CallGraphSCCPass *CGSP = (CallGraphSCCPass *)P; if (!CallGraphUpToDate) { DevirtualizedCall |= RefreshCallGraph(CurSCC, CG, false); CallGraphUpToDate = true; @@ -140,13 +140,13 @@ bool CGPassManager::RunPassOnSCC(Pass *P, CallGraphSCC &CurSCC, 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); + int64_t Delta = + static_cast<int64_t>(SCCCount) - static_cast<int64_t>(InstrCount); + emitInstrCountChangedRemark(P, M, Delta, InstrCount); InstrCount = SCCCount; } } |