[PATCH] D135042: [opt] Don't initialize legacy instrumentation passes

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 21:55:00 PDT 2022


aeubanks added a comment.

In D135042#3829765 <https://reviews.llvm.org/D135042#3829765>, @nikic wrote:

> It's kind of off-topic to this specific change, but I kind of feel like we're fighting an unnecessary crusade to migrate tests to the `-passes` syntax, which is not really an improvement for simple cases. I wonder if it would be possible to collect any unknown opt arguments that match a pass name and interpret them as `-passes` automatically?

When I started working on LLVM, I found the `opt -instcombine` syntax confusing. For extremely simple cases where it's just `opt -instcombine` with no other flags it makes sense, but once you start adding other passes or flags, it's hard to distinguish at a glance what exactly is happening, and confusing to people unfamiliar with `opt` syntax. `-passes` makes this much clearer IMO.

Maybe we could do something with your idea of collecting unknown arguments, but not sure it's worth the confusion. (looks like there's a `cl::Sink` that does this; it's unused throughout LLVM aside from tests)

WDYT about a short `-p` alias for `-passes`?

Maybe this should be an RFC...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135042



More information about the llvm-commits mailing list