[LLVMdev] add pass to O2. use as "clang -O2 .."

Yuanfang Chen cyfmxc at gmail.com
Mon Nov 14 22:50:10 PST 2011


Hello folks,

I wrote a transforming looppass for my project, opt --help can see it. I
want clang to use my pass too, so that I don't have to compile to IR, opt,
and then llc to binary manually. Now I am trying to add my pass to O2
by mimicking LICM pass.

I add a line "MPM.add(createMyPass());"
in PassManagerBuilder::populateModulePassManager, and got assertion fail
"void llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI &&
"Expected required passes to be initialized"' failed."  I can't figure out
how to solve this?  thanks for any inputs.

yuanfang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111115/fd89ce69/attachment.html>


More information about the llvm-dev mailing list