Trying to run WholeProgramDevirt pass but can't find it under opt

Hi,

I’m a beginner in LLVM and I’m trying to run the devirtualization pass on some code using LLVM 12.0.1. I can find such a pass already implemented at ./llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

However, using opt does not give me such an option to pass this flag as a parameter. This pass wasn’t listed when I did ‘opt --help’

Can someone please point me to how to run the WholeProgramDevirt pass? Any pointers would be really helpful.

Thanks,
Christin

You can see the options related to this pass under hidden options. Try ’ opt --help-hidden | grep “wholeprogramdevirt” '.

Can someone please point me to how to run the WholeProgramDevirt pass? Any pointers would be really helpful.

Search for the pass string (wholeprogramdevirt) inside the test directory (llvm/test/Transforms to be precise) to see how this pass is invoked.