This is an archive of the discontinued LLVM Phabricator instance.

[NPM] Added -print-pipeline-passes print params for a few passes.
ClosedPublic

Authored by markus on Sep 6 2021, 3:41 AM.

Details

Summary

This is a follow up to D108298

[NPM] Added -print-pipeline-passes print params for a few passes.

Added '-print-pipeline-passes' printing of parameters for those passes
declared with *_WITH_PARAMS macro in PassRegistry.def.

Note that it only prints the parameters declared inside *_WITH_PARAMS as
in a few cases there appear to be additional parameters not parsable.

The following passes are now covered (i.e. all of those with *_WITH_PARAMS in
PassRegistry.def).

LoopExtractorPass - loop-extract
HWAddressSanitizerPass - hwsan
EarlyCSEPass - early-cse
EntryExitInstrumenterPass - ee-instrument
LowerMatrixIntrinsicsPass - lower-matrix-intrinsics
LoopUnrollPass - loop-unroll
AddressSanitizerPass - asan
MemorySanitizerPass - msan
SimplifyCFGPass - simplifycfg
LoopVectorizePass - loop-vectorize
MergedLoadStoreMotionPass - mldst-motion
GVN - gvn
StackLifetimePrinterPass - print<stack-lifetime>
SimpleLoopUnswitchPass - simple-loop-unswitch

Diff Detail

Event Timeline

markus created this revision.Sep 6 2021, 3:41 AM
markus requested review of this revision.Sep 6 2021, 3:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2021, 3:41 AM
markus added a comment.Sep 6 2021, 3:47 AM

Obviously tests are needed but besides that is there anything fundamentally problematic about this patch?

I would consider this a shorter term hack and eventually we should unify the pass parameter parsing and parameter printing in some way. That way could be having a PassParams base class that one would derive from and register parameters. The base class would make sure that all registered parameters were both printable and parsable so that we could not end up in the situations where we forget to update the printing after adding a parsable parameter.

it seems weird to sometimes print name<> with nothing between the <> but I think this is fine

llvm/lib/Transforms/IPO/LoopExtractor.cpp
292

maybe we can directly print NumLoops (and change the parsing)

Matt added a subscriber: Matt.Sep 6 2021, 5:39 PM
markus updated this revision to Diff 372418.Sep 14 2021, 12:30 AM

Added tests.

markus added inline comments.Sep 14 2021, 12:31 AM
llvm/lib/Transforms/IPO/LoopExtractor.cpp
292

I do not disagree but isn't it better to do that in a separate commit?

aeubanks accepted this revision.Sep 14 2021, 9:55 AM
This revision is now accepted and ready to land.Sep 14 2021, 9:55 AM
bjope added inline comments.Sep 14 2021, 11:01 AM
llvm/test/Other/new-pm-print-pipeline.ll
20–63

nit: Maybe nicer to leave the old "CHECK-5" test here, and move this one with loop-vectorizer params to the bottom (as CHECK-19 instead).