summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-02-23 17:30:01 +0000
committerAdam Nemet <anemet@apple.com>2017-02-23 17:30:01 +0000
commite73243639ab291d8d532b1aca22d677990184586 (patch)
tree35586bb01e579ed8a95f14b28ae067d9b769ecbf /lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
parentc5d447ad7744016b65c8aec0358879080a7cf6ef (diff)
[LazyMachineBFI] Reimplement with getAnalysisIfAvailable
Since LoopInfo is not available in machine passes as universally as in IR passes, using the same approach for OptimizationRemarkEmitter as we did for IR will run LoopInfo and DominatorTree unnecessarily. (LoopInfo is not used lazily by ORE.) To fix this, I am modifying the approach I took in D29836. LazyMachineBFI now uses its client passes including MachineBFI itself that are available or otherwise compute them on the fly. So for example GreedyRegAlloc, since it's already using MBFI, will reuse that instance. On the other hand, AsmPrinter in Justin's patch will generate DT, LI and finally BFI on the fly. (I am of course wondering now if the simplicity of this approach is even preferable in IR. I will do some experiments.) Testing is provided by an updated version of D29837 which requires Justin's patch to bring ORE to the AsmPrinter. Differential Revision: https://reviews.llvm.org/D30128 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineOptimizationRemarkEmitter.cpp')
-rw-r--r--lib/CodeGen/MachineOptimizationRemarkEmitter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp b/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
index b76e75a4bd4..b226135f8f7 100644
--- a/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
+++ b/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
@@ -74,7 +74,7 @@ bool MachineOptimizationRemarkEmitterPass::runOnMachineFunction(
void MachineOptimizationRemarkEmitterPass::getAnalysisUsage(
AnalysisUsage &AU) const {
- LazyMachineBlockFrequencyInfoPass::getLazyMachineBFIAnalysisUsage(AU);
+ AU.addRequired<LazyMachineBlockFrequencyInfoPass>();
AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU);
}
@@ -85,6 +85,6 @@ static const char ore_name[] = "Machine Optimization Remark Emitter";
INITIALIZE_PASS_BEGIN(MachineOptimizationRemarkEmitterPass, ORE_NAME, ore_name,
false, true)
-INITIALIZE_PASS_DEPENDENCY(LazyMachineBFIPass)
+INITIALIZE_PASS_DEPENDENCY(LazyMachineBlockFrequencyInfoPass)
INITIALIZE_PASS_END(MachineOptimizationRemarkEmitterPass, ORE_NAME, ore_name,
false, true)