[PATCH] D136617: [opt] Print deprecation warning for use of legacy syntax with new pass manager

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 00:26:01 PDT 2022


bjope added inline comments.


================
Comment at: llvm/test/Other/opt-legacy-syntax-deprecation.ll:6
+; RUN: opt /dev/null -disable-output -instcombine -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=OK --allow-empty
+
+; OK-NOT: deprecated
----------------
Could perhaps add a RUN line using -codegenprepare (or some other pass hardcoded into using legacy PM) to show that we do not give a warning for those.


================
Comment at: llvm/tools/opt/opt.cpp:756
+      errs() << PassList[0]->getPassArgument();
+      for (auto &P : drop_begin(PassList)) {
+        errs() << "," << P->getPassArgument();
----------------
While giving the list of passes here might be helpful, maybe we should just say "please use opt -passes=<pipeline>" or something instead.
Here are some (minor) concerns:
1) The suggested pipeline won't give identical behavior (e.g. if the test case that should be converted is some old bug reproducer it might be more interesting to use something more similar to what -print-pipeline-passes would output (including pass manager nestings etc).
2) The more text we output here (also including names of passes) the higher the risk that some test case would fail/pass incorrectly when FileCheck also looks at stderr.

But I don't know really. Maybe better to try to be helpful in the warning message anyway. One idea is to suggest using -print-pipeline-passes to get an idea for how the pipeline should look like, but that also makes the warning a bit longer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136617/new/

https://reviews.llvm.org/D136617



More information about the llvm-commits mailing list