<div dir="ltr">If you look at adding simplify cfg to your pass pipeline - look at toy.cpp - I believe it adds simplifyCFG pass asĀ <div><br></div><div><div>TheFPM->add(createCFGSimplificationPass());</div></div><div><br></div><div>Aditya</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 19, 2015 at 11:29 PM Russell Wallace via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>