[llvm-dev] How to register a pass as being optional?

Phil Tomson via llvm-dev llvm-dev at lists.llvm.org
Mon May 9 17:26:34 PDT 2016


I've created a post-RA pass runOnMachineFunction that gets registed with
the pass manager like this:


static RegisterPass<RegBankFixUpPass> X("regbankfixup", "Register Bank
Conflict FixUp Pass");

And and whenever I run clang or llc now the pass runs. Initially, until I'm
sure this pass doesn't break things I'd like it to be opt-in - ie I'd like
to have the pass run only when the -regbankfixup commandline option is
passed to clang or llc, but this seems doable only from opt. Is there no
way to set things up such that the pass gets run when an option is passed
to llc or (ideally) clang?

Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160509/fbdc4852/attachment.html>


More information about the llvm-dev mailing list