[PATCH] D64681: Stop IR Dumps occurring after MachineVerifier

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 11:54:50 PDT 2019


dsanders added a comment.

In D64681#1597639 <https://reviews.llvm.org/D64681#1597639>, @czhang wrote:

> Seems like the same reasoning could apply to any type of immutable pass, not just verifier passes. It seems a little ad-hoc to single out the machine verifier pass for IR dumping. The benefit of treating all immutable passes this way is that one can simply disable printing based on class.


I agree but ImmutablePasses already avoid printing the IR as they go into the if-statement on line 775 which returns on line 784 before we get to the code that adds the printers. MachineVerifierPass is somewhat special in that it has the effect of an ImmutablePass but needs to be run like a normal pass. It's a MachineFunctionPass so that it's inserted between each pass without needing anyone/everyone to call getAnalysis<MachineVerifierPass>() and it can't be skipped by setPreservesAll() like an ImmutablePass can. However, it doesn't actually change the IR so it doesn't make sense to print the IR before/after it like other MachineFunctionPasses.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64681





More information about the llvm-commits mailing list