[cfe-users] Using clang LTO with POLLY

Brandon Simmons via cfe-users cfe-users at lists.llvm.org
Fri May 10 10:28:32 PDT 2019

I'm hacking on a compiler with a fairly complicated build system and trying
to experiment with POLLY (https://polly.llvm.org) alongside LLVM LTO.

The general shape of the last part of compilation looks like:

    opt-6.0 -O2 -enable-tbaa -tbaa '-relocation-model=static'
application.ll -o application.o
    clang -flto -c /tmp/baz_3.c -o /tmp/baz_4.o
    clang -flto -o /tmp/floop -Wl,--gc-sections application.o
-L/lots_of_lto_objs_here /tmp/baz_4.o -Wl,-u,foo -Wl,-u,bar -llto_obj1
-lto_obj2 -letc -lnuma

In the last step we link a whole bunch of LLVM LTO objects (LLVM IR
bitcode, as I understand it). This seems to work fine, but now I'm
struggling to add POLLY into the mix.

If I add `-O3 -mllvm -polly` to the last clang invocation, I just get

    clang: warning: argument unused during compilation: '-mllvm -polly'

Is there a convenient way to use POLLY with LTO? I've seen
but I'm not sure how to adapt that to what I need in a convenient way since
I'm doing a lot of shimming of `clang`, `lld`, etc in order to get as far
as I have.

I think I need to stay on llvm/clang v6, although newer `lld` seemed to
work fine.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20190510/8e688a31/attachment.html>

More information about the cfe-users mailing list