[llvm-dev] How to invoke simplifycfg from code

Aditya Nandakumar via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 20 03:36:11 PDT 2015


If you look at adding simplify cfg to your pass pipeline - look at toy.cpp
- I believe it adds simplifyCFG pass as

TheFPM->add(createCFGSimplificationPass());

Aditya


On Sat, Sep 19, 2015 at 11:29 PM Russell Wallace via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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.
>
> 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?
>
> 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?
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150920/367c34c6/attachment.html>


More information about the llvm-dev mailing list