[llvm-dev] Apply optimization passes with short names

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 11 09:20:22 PST 2016


If you look for all the calls to the INITIALIZE_PASS_BEGIN macro in LLVM
(all in lib/{Transforms,Analysis}/**/*.cpp) you should find all the
short/long name pairs, I think.

On Mon, Jan 11, 2016 at 6:31 AM, Adrien DEGRANGE via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi all,
>
> I apologize for bothering you, but even after many efforts, I can't solve
> my issue.
>
> There is a great command-line optimizer tool, "opt", which can apply
> optimization passes to the IR code :
> opt -mem2reg -S myFile.ll -o myFile.ll
>
> With that tool, an optimization pass is referred as its "short name"
> (mem2reg), and these passes are pretty well documented, for instance here:
> http://llvm.org/docs/Passes.html
>
> However, if I want to apply the same optimization pass in a C++ code, I
> have to call a specific function, such as:
> myPassManager->add(createPromoteMemoryToRegisterPass());
>
> The link between the "mem2reg" short name and the
> "createPromoteMemoryToRegister" function is pretty obvious, but not
> completely straightforward.
> Is there any dictionary, or at least a comprehensive documentation about
> these translations?
>
> Thanks a lot in advance!
>
> Have a great day,
>
> AD
>
> Adrien Dégrange
> Recherche & Développement
>
>
>
> _______________________________________________
> 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/20160111/517839d9/attachment.html>


More information about the llvm-dev mailing list