<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I'm hacking on a compiler with a fairly complicated build system and trying to experiment with POLLY (<a href="https://polly.llvm.org">https://polly.llvm.org</a>) alongside LLVM LTO. <br></div><div dir="ltr"><br></div><div>The general shape of the last part of compilation looks like:</div><div><br></div><div>    opt-6.0 -O2 -enable-tbaa -tbaa '-relocation-model=static' application.ll -o application.o<br>    clang -flto -c /tmp/baz_3.c -o /tmp/baz_4.o<br>    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</div><div><br></div><div>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.</div><div><br></div><div>If I add `-O3 -mllvm -polly` to the last clang invocation, I just get <br></div><div><br></div><div>    clang: warning: argument unused during compilation: '-mllvm -polly' [-Wunused-command-line-argument]</div><div><br></div><div>Is there a convenient way to use POLLY with LTO? I've seen <a href="http://polly.llvm.org/docs/HowToManuallyUseTheIndividualPiecesOfPolly.html">http://polly.llvm.org/docs/HowToManuallyUseTheIndividualPiecesOfPolly.html</a>  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.<br></div><div><br></div><div>I think I need to stay on llvm/clang v6, although newer `lld` seemed to work fine.</div><div><br></div><div>Thanks,</div><div>Brandon</div><div><a href="http://brandon.si">http://brandon.si</a><br></div></div></div></div></div></div>