[PATCH] D112036: [opt] Directly translate -O# to -passes='default<O#>'

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 16:47:55 PDT 2021


aeubanks added inline comments.


================
Comment at: llvm/tools/opt/opt.cpp:790
     if (OptLevelO0)
-      Passes.push_back("default<O0>");
+      Pipeline = "default<O0>";
     if (OptLevelO1)
----------------
tra wrote:
> A drive-by usability nit, probably for a different/separate patch: 
> 
> I may be revisiting an old bike-shed, but it would be nice to avoid using characters that require quoting.  IMO `--passes=O3` would be as easy to understand as `--passes=default<O3>`, would require a bit less typing for a very common use case, and would not need to have everything quoted in many cases that would need it now (though quoting in general seems unavoidable as we have things like `function(....)`).
> 
If I had to guess why that wasn't added, it'd probably be that we want to distinguish the default pipelines and the (Thin)LTO pipelines, since they all take an optimization level parameter, e.g. `thinlto<O3>` or `lto-pre-link<Oz>`.
But actually testing the non-default pipelines is rare and I agree that `-passes=O3` should be fine in most cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112036



More information about the llvm-commits mailing list