[PATCH] D102205: CodeGen: Make all passes preserve MachineOptimizationRemarkEmitterPass

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 19:08:33 PDT 2021


aeubanks added a comment.

In D102205#2749555 <https://reviews.llvm.org/D102205#2749555>, @arsenm wrote:

> In D102205#2749491 <https://reviews.llvm.org/D102205#2749491>, @aeubanks wrote:
>
>>   /// 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?
>
> 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)

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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102205/new/

https://reviews.llvm.org/D102205



More information about the llvm-commits mailing list