This is an archive of the discontinued LLVM Phabricator instance.

[NPM] Complementary fixes for opt option -print-pipeline-passes
ClosedPublic

Authored by bjope on Sep 9 2021, 1:32 PM.

Details

Summary

Make sure we handle some more adaptors etc (such as cgscc and devirt).

Diff Detail

Event Timeline

bjope created this revision.Sep 9 2021, 1:32 PM
bjope requested review of this revision.Sep 9 2021, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2021, 1:32 PM
aeubanks added inline comments.Sep 9 2021, 1:41 PM
llvm/include/llvm/IR/PassManager.h
388

IIRC (and I might not be), there was some issue with different compilers providing slightly different names

But those classes can just manually override name() anyway, so I don't think this is necessary

bjope added inline comments.Sep 9 2021, 1:50 PM
llvm/include/llvm/IR/PassManager.h
388

It seems like the name() function that called is the one above, even if "struct NoOpModulePass" etc in PassBuilder.cpp has a their own name() functions. Not sure exactly why but those static functions aren't virtual(?).

One solution if "(anonymous namespace)::" isn't "portable" would be to add printPipeline methods in those structs in PassBuilder.cpp that is in the anonymous namespace.
Or maybe we could add some llvmtest namespace or similar (if the anonymous namespace is used just to avoid having those testing purpose passes in the regular llvm namespace (or why can't they be in the llvm namespace).

bjope added inline comments.Sep 9 2021, 2:01 PM
llvm/include/llvm/IR/PassManager.h
386

I think this should use DerivedT::name() and then I can remove the consume_front below.

bjope updated this revision to Diff 371721.Sep 9 2021, 2:08 PM

Fix how to get name for NoOp passes (related to anonymous namespace).

aeubanks accepted this revision.Sep 9 2021, 2:22 PM
This revision is now accepted and ready to land.Sep 9 2021, 2:22 PM