[PATCH] D149345: [Utils] Added the ability to print the pass number and IR after it is triggered
Dmitry Bakunevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 23 15:45:01 PDT 2023
dbakunevich added inline comments.
================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:772
+ if (shouldPrintPassNumbers())
+ dbgs() << " Running pass " << CurrentPassNumber << " " << PassID << "\n";
+
----------------
aeubanks wrote:
> dbakunevich wrote:
> > aeubanks wrote:
> > > aeubanks wrote:
> > > > extra space?
> > > ditto for the one in printAfterPass, but actually shouldn't this go in printBeforePass?
> > No, this logic should be near with PrintAtPassNumber.
> I definitely think
> ```
> ++CurrentPassNumber;
>
> if (shouldPrintPassNumbers())
> dbgs() << "Running pass " << CurrentPassNumber << " " << PassID << "\n";
> ```
> should be in printBeforePass, there's no reason to duplicate it between the two printAfterPasses (e.g. the extra space wasn't updated in the copy above)
We can't do that because the before and after passes are different. Accordingly, if we transfer the printing of a pass with its ordinals to printBeforePass(), then the pass numbers will not correspond to those that can be displayed in printAfterPasses().
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149345/new/
https://reviews.llvm.org/D149345
More information about the llvm-commits
mailing list