[PATCH] D96101: [opt][NewPM] Add a --print-passes flag to print all available passes
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 4 20:07:23 PST 2021
aeubanks created this revision.
Herald added a subscriber: hiraditya.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
It seems nicer to list passes given a flag rather than displaying all
passes in opt --help.
This is awkwardly structured because a PassBuilder is required, but
reusing the PassBuilder in runPassPipeline() doesn't work because we
read the input IR before getting to runPassPipeline(). So printing the
list of passes needs to happen before reading the input IR. If we remove
the legacy PM code in main() and move everything from NewPMDriver.cpp
into opt.cpp, we can create the PassBuilder before reading IR and check
if we should print the list of passes and exit. But until then this hack
seems fine.
Compared to the legacy PM, the new PM passes are lacking descriptions.
We'll need to figure out a way to add descriptions if we think this is
important.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96101
Files:
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/print-passes.ll
llvm/tools/opt/NewPMDriver.cpp
llvm/tools/opt/NewPMDriver.h
llvm/tools/opt/opt.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96101.321641.patch
Type: text/x-patch
Size: 5222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210205/a290b8d4/attachment.bin>
More information about the llvm-commits
mailing list