diff --git a/llvm/docs/NewPassManager.rst b/llvm/docs/NewPassManager.rst --- a/llvm/docs/NewPassManager.rst +++ b/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 diff --git a/llvm/test/Other/new-pass-manager.ll b/llvm/test/Other/new-pass-manager.ll --- a/llvm/test/Other/new-pass-manager.ll +++ b/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 \ diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp --- a/llvm/tools/opt/opt.cpp +++ b/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'.")); +static cl::alias PassPipeline2("p", cl::aliasopt(PassPipeline), + cl::desc("Alias for -passes")); static cl::opt PrintPasses("print-passes", cl::desc("Print available passes that can be "