This is an archive of the discontinued LLVM Phabricator instance.

[opt] Don't initialize legacy instrumentation passes
ClosedPublic

Authored by aeubanks on Oct 2 2022, 2:10 PM.

Details

Summary

So that we require opt -passes= syntax for instrumentation passes.

Diff Detail

Event Timeline

aeubanks created this revision.Oct 2 2022, 2:10 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: jdoerfert. · View Herald Transcript
aeubanks requested review of this revision.Oct 2 2022, 2:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2022, 2:10 PM
nikic added a comment.Oct 2 2022, 2:39 PM

It's kind of off-topic to this specific change, but I kind of feel like we're fighting an unnecessary crusade to migrate tests to the -passes syntax, which is not really an improvement for simple cases. I wonder if it would be possible to collect any unknown opt arguments that match a pass name and interpret them as -passes automatically?

It's kind of off-topic to this specific change, but I kind of feel like we're fighting an unnecessary crusade to migrate tests to the -passes syntax, which is not really an improvement for simple cases. I wonder if it would be possible to collect any unknown opt arguments that match a pass name and interpret them as -passes automatically?

When I started working on LLVM, I found the opt -instcombine syntax confusing. For extremely simple cases where it's just opt -instcombine with no other flags it makes sense, but once you start adding other passes or flags, it's hard to distinguish at a glance what exactly is happening, and confusing to people unfamiliar with opt syntax. -passes makes this much clearer IMO.

Maybe we could do something with your idea of collecting unknown arguments, but not sure it's worth the confusion. (looks like there's a cl::Sink that does this; it's unused throughout LLVM aside from tests)

WDYT about a short -p alias for -passes?

Maybe this should be an RFC...

nikic accepted this revision.Oct 7 2022, 2:24 PM

LGTM -- I assume you plan to follow up on this by actually dropping the remaining legacy instrumentation passes? Most of them have already been removed.

llvm/test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll
1

Can drop the verify while here.

This revision is now accepted and ready to land.Oct 7 2022, 2:24 PM
This revision was automatically updated to reflect the committed changes.