[opt] Remove support for using -O[0|1|2|3|s|z] with legacy PM in opt
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 8 Nov 2022 20:19:25 +0000 (21:19 +0100)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Fri, 11 Nov 2022 08:17:05 +0000 (09:17 +0100)
commit7a5332b9b5584cec4517196ee86f8f3af2b78cd9
tree44f13c324d848ef1fd287037346f584c0ebbd016
parent6663f3470417523141ee87923840d17b35d6b4c7
[opt] Remove support for using -O[0|1|2|3|s|z] with legacy PM in opt

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.

Differential Revision: https://reviews.llvm.org/D137663
llvm/test/Other/opt-On.ll
llvm/tools/opt/opt.cpp