[PATCH] D137663: [opt] Remove support for using -O[0|1|2|3|s|z] with legacy PM in opt

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 12:25:17 PST 2022


bjope created this revision.
bjope added a reviewer: aeubanks.
Herald added subscribers: kosarev, mattd, gchakrabarti, asavonic, foad, kerbowa, hiraditya, jvesely, arsenm.
Herald added a project: All.
bjope requested review of this revision.
Herald added subscribers: pcwang-thead, jholewinski.
Herald added a project: LLVM.

When running a default pipeline (for a specific O-level) in opt it is
now expected that the new PM should be used. Only reason to use the
legacy PM is when testing a pass that is locked to the legacy PM (or
when testing single passes, for example used by the llc backend).

If a test should run both a default pipeline plus some other passes,
the solution would be to invoke opt twice (separating the default
pipeline execution from the execution of individual passes).

Starting with this patch "opt -O0" etc. will result in an error.

As a side effect, as the last use was removed, the
TargetMaching::adjustPassManager function has been removed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137663

Files:
  llvm/include/llvm/Target/TargetMachine.h
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
  llvm/lib/Target/BPF/BPFTargetMachine.cpp
  llvm/lib/Target/BPF/BPFTargetMachine.h
  llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
  llvm/lib/Target/Hexagon/HexagonTargetMachine.h
  llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
  llvm/lib/Target/NVPTX/NVPTXTargetMachine.h
  llvm/tools/opt/opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137663.474068.patch
Type: text/x-patch
Size: 13751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221108/7a07011f/attachment.bin>


More information about the llvm-commits mailing list