[PATCH] D136616: [opt] Add -p alias for -passes
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 2 10:47:06 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5b30fc23696e: [opt] Add -p alias for -passes (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136616/new/
https://reviews.llvm.org/D136616
Files:
llvm/docs/NewPassManager.rst
llvm/test/Other/new-pass-manager.ll
llvm/tools/opt/opt.cpp
Index: llvm/tools/opt/opt.cpp
===================================================================
--- llvm/tools/opt/opt.cpp
+++ llvm/tools/opt/opt.cpp
@@ -85,6 +85,8 @@
cl::desc(
"A textual description of the pass pipeline. To have analysis passes "
"available before a certain pass, add 'require<foo-analysis>'."));
+static cl::alias PassPipeline2("p", cl::aliasopt(PassPipeline),
+ cl::desc("Alias for -passes"));
static cl::opt<bool> PrintPasses("print-passes",
cl::desc("Print available passes that can be "
Index: llvm/test/Other/new-pass-manager.ll
===================================================================
--- llvm/test/Other/new-pass-manager.ll
+++ llvm/test/Other/new-pass-manager.ll
@@ -8,6 +8,9 @@
; RUN: opt -disable-output -disable-verify -verify-cfg-preserved=1 -debug-pass-manager \
; RUN: -passes=no-op-module %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PASS
+; RUN: opt -disable-output -disable-verify -verify-cfg-preserved=1 -debug-pass-manager \
+; RUN: -p no-op-module %s 2>&1 \
+; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PASS
; CHECK-MODULE-PASS: Running pass: NoOpModulePass
; RUN: opt -disable-output -disable-verify -verify-cfg-preserved=1 -debug-pass-manager \
Index: llvm/docs/NewPassManager.rst
===================================================================
--- llvm/docs/NewPassManager.rst
+++ llvm/docs/NewPassManager.rst
@@ -430,6 +430,8 @@
.. code-block:: shell
$ opt -passes='pass1,pass2' /tmp/a.ll -S
+ # -p is an alias for -passes
+ $ opt -p pass1,pass2 /tmp/a.ll -S
The new PM typically requires explicit pass nesting. For example, to run a
function pass, then a module pass, we need to wrap the function pass in a module
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136616.472690.patch
Type: text/x-patch
Size: 1826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221102/612fed81/attachment.bin>
More information about the llvm-commits
mailing list