This is an archive of the discontinued LLVM Phabricator instance.

[opt] Print deprecation warning for use of legacy syntax with new pass manager
ClosedPublic

Authored by aeubanks on Oct 24 2022, 9:44 AM.

Details

Summary

And a possible opt invocation plus a link to more extensive documentation.

Diff Detail

Event Timeline

aeubanks created this revision.Oct 24 2022, 9:44 AM
Herald added a project: Restricted Project. · View Herald Transcript
aeubanks requested review of this revision.Oct 24 2022, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 9:44 AM
bjope added inline comments.Oct 25 2022, 12:26 AM
llvm/test/Other/opt-legacy-syntax-deprecation.ll
7

Could perhaps add a RUN line using -codegenprepare (or some other pass hardcoded into using legacy PM) to show that we do not give a warning for those.

llvm/tools/opt/opt.cpp
720

While giving the list of passes here might be helpful, maybe we should just say "please use opt -passes=<pipeline>" or something instead.
Here are some (minor) concerns:

  1. The suggested pipeline won't give identical behavior (e.g. if the test case that should be converted is some old bug reproducer it might be more interesting to use something more similar to what -print-pipeline-passes would output (including pass manager nestings etc).
  2. The more text we output here (also including names of passes) the higher the risk that some test case would fail/pass incorrectly when FileCheck also looks at stderr.

But I don't know really. Maybe better to try to be helpful in the warning message anyway. One idea is to suggest using -print-pipeline-passes to get an idea for how the pipeline should look like, but that also makes the warning a bit longer.

aeubanks added inline comments.Oct 28 2022, 5:15 PM
llvm/tools/opt/opt.cpp
720
  1. the translation from -pass1 -pass2 syntax to the actual new PM pipeline is already different from how the passes were run in the legacy PM, they're not interleaved with the new PM but they were with the legacy PM. interleaving passes is usually how pipelines should be run. it's possible that we were testing some edge case before and we're missing coverage now, but I don't think it's a huge deal, especially since a lot of those bugs are pass manager bugs that aren't an issue with the new PM
  2. if a test outputs this message, it shouldn't be using the legacy syntax anyway and should be updated

but anyway, made the message generic so it's less confusing if it doesn't actually work (e.g. func-pass,module-pass)

bjope added a comment.Nov 1 2022, 1:47 PM

This currently depends on D136616 since it refer to the -p option. I think it looks good otherwise.

aeubanks updated this revision to Diff 473861.Nov 7 2022, 7:47 PM

whoops, never uploaded patch

asbirlea accepted this revision.Nov 15 2022, 10:24 AM
This revision is now accepted and ready to land.Nov 15 2022, 10:24 AM
This revision was landed with ongoing or failed builds.Nov 15 2022, 2:31 PM
This revision was automatically updated to reflect the committed changes.