This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by bjope on Nov 8 2022, 12:25 PM.

Details

Summary

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.

Diff Detail

Event Timeline

bjope created this revision.Nov 8 2022, 12:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 12:25 PM
bjope requested review of this revision.Nov 8 2022, 12:25 PM
bjope added inline comments.
llvm/tools/opt/opt.cpp
760

I should probably add a test case for this.

bjope updated this revision to Diff 474174.Nov 9 2022, 12:19 AM

Added lit test.

could you also remove references to adjustPassManager in the documentation?
might be better to separate out removing adjustPassManager into another change

bjope updated this revision to Diff 474587.Nov 10 2022, 12:10 PM

Splitted out removal of adjustPassManager.

aeubanks accepted this revision.Nov 10 2022, 1:33 PM
This revision is now accepted and ready to land.Nov 10 2022, 1:33 PM