This is in preparation for supporting -debugify-each, which adds a debug
info pass before and after each pass.
Switch VerifyEach to use this.
Paths
| Differential D88107
[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass ClosedPublic Authored by aeubanks on Sep 22 2020, 11:06 AM.
Details Summary This is in preparation for supporting -debugify-each, which adds a debug Switch VerifyEach to use this.
Diff Detail
Event Timeline
Comment Actions LGTM. Thanks.
This revision is now accepted and ready to land.Sep 22 2020, 6:02 PM This revision was landed with ongoing or failed builds.Sep 23 2020, 3:28 PM Closed by commit rG111aa4e36614: [NewPM] Add callbacks to PassBuilder to run before/after parsing a pass (authored by aeubanks). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions Turns out this doesn't actually work as intended... Comment Actions Actually, doing verify-each in StandardInstrumentations seems much nicer. Not sure about how to do debugify-each though, filed https://bugs.llvm.org/show_bug.cgi?id=47633. Comment Actions
If debugify-each has or could be made to have a standalone function interface, could it use StandardInstrumentations? Comment Actions
The issue is that it modifies the IR, which can't be done from StandardInstrumentations (invalidating analyses, etc.). Comment Actions
I worked on test/DebugInfo from a task list by @aeubanks and found this thread just after I posted my -debugify-each patch D90365:) I have tried StandardInstrumentations but switched to moving all stuff in Debugify.cpp because that seems cleaner (I don't want things in Debugify.cpp leak to other places).
Revision Contents
Diff 293878 llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
llvm/tools/opt/NewPMDriver.cpp
llvm/unittests/IR/PassBuilderCallbacksTest.cpp
polly/lib/Support/RegisterPasses.cpp
|
How about adding a "StringRef Element" as the first callback parameter? I could not think of a concrete use case for it now. But it is more general and canonical. The current interface is restricted to callbacks that do something for every pass.
For the name, why not just use before/after instead of willParse/parsed?