<div dir="ltr"><div>Simplifycfg doesn't get run by default even with -O3, but 'opt -simplifycfg' can do it. I'm looking to add this functionality to an optimizer program that uses the llvm libraries. What's the best way to do this? I don't really mind whether it becomes available as a command line option as in opt, or I need to hardcode it as always on.</div><div><br></div><div>To make it available as a command line option... I'm looking at the code for opt, but it makes no reference to simplifycfg anywhere in the code. I'm guessing it does something else that gets that option linked in and somehow thereby connects that to activating the actual pass; how is this done?</div><div><br></div><div>Alternatively in an attempt to hardwire it I got as far as FPM.add(new SimplifyCFGPass); but that fails to compile because SimplifyCFGPass isn't of a compatible type, which indeed it isn't; what should I be doing here?</div></div>