This avoids rerunning it a few times.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
/// The analysis pass /// /// Note that this pass shouldn't generally be marked as preserved by other /// passes. It's holding onto BFI, so if the pass does not preserve BFI, BFI /// could be freed. class MachineOptimizationRemarkEmitterPass : public MachineFunctionPass {
are you sure this is correct?
Comment Actions
I found a bug in some null checks for the BFI, but once that's fixed no tests fail (e.g. MachineBlockFrequencyInfo::getBlockProfileCount checks for null after deref)
Comment Actions
But if there is a BFI and a pass doesn't update it, then MachineOptimizationRemarkEmitterPass shouldn't be preserved since its BFI will be out of date.
Comment Actions
Do you mean have MachineOptimizationRemarkEmitter setPreservesCFG? It already uses setPreservesAll
Comment Actions
I mean change
INITIALIZE_PASS_END(MachineOptimizationRemarkEmitterPass, ORE_NAME, ore_name, false, true)
to
INITIALIZE_PASS_END(MachineOptimizationRemarkEmitterPass, ORE_NAME, ore_name, true, true)
That should make it so passes that don't modify the CFG don't invalidate the analysis