How to dump a .bc file before/after a specific opt pass?

Hi, all. I’m adding a new pass in opt. To make the debugging easier, I’m trying to
draw the CFG before and after the new pass. Is there any an option to dump the
.bc file before/after a specific opt pass? Thanks.

Xiaoming

Hi,

If you’re using opt, you can use -print-module to dump the module.
So “opt -S file.ll -print-module -your-opt -print-module”, or something like that.

Joey