[llvm-dev] question about mem2reg

Heejin Ahn via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 15 03:22:38 PDT 2017


Hello Linhai,

When compiled with -O0, clang 5.0 started to add optnone attribute to each
function, which prevents further optimizations afterwards including mem2reg
pass. To prevent that, add "-Xclang -disable-O0-optnone" to clang command
line arguments.

Thank you,
Heejin

On Sat, Oct 14, 2017 at 8:59 PM Linhai Song via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello,
>
>
> I just upgraded my llvm to 5.0.0. I applied mem2reg pass as follows:
>
>
> opt -mem2reg m2rtttl.bc > m2rtttl.opt
>
>
> But after that, I compared m2rtttl.bc and m2rtttl.opt. I noticed that
> there are no difference between m2rtttl.bc and m2rtttl.opt. Did I apply
> llvm in the correct way?
>
>
> Thanks a lot for the help!
>
>
> Best,
>
>
>                            Linhai
> _______________________________________________
> 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/20171015/e774a1ec/attachment.html>


More information about the llvm-dev mailing list