<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 3, 2016, at 8:07 AM, Johan Engelen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">With `save-temps` as plugin option, I get extra files for the MAIN module (called `a.o`): `a.o.opt.bc` and `a.thinlto.bc`.</div></div></blockquote><div><br class=""></div><div>I’d expect as temps `a.thinlto.bc` for the index + one file per input. Also there should be a number like: `a.o.4.opt.bc`</div><div><br class=""></div><div>Can you attach the generated temp files?</div><div><br class=""></div><div>Thanks,</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">The `a.thinlto.bc` file contains nothing, only `source_filename = ...` .</div><div class="">The `a.o.opt.bc` (this looks like the result after ThinLTO importing and optimization) contains the assembly block that it should not have:</div><div class="">```</div><div class=""><div class="">module asm "\09.text"</div><div class="">module asm "\09.globl\09foo"</div><div class="">module asm "\09.align\0916, 0x90"</div><div class="">module asm "\09.type\09foo,@function"</div><div class="">module asm "foo:"</div><div class="">module asm "\09movq %rdi, %rax"</div><div class="">module asm "\09rorw $8, %ax"</div><div class="">module asm "\09ret "</div><div class="">module asm "\09.size\09foo, .-foo"</div><div class="">module asm ""</div></div><div class="">```</div><div class="">The asm is the same as in the other module (where it _should_ be defined), and the linkage has not been changed.</div><div class=""><br class=""></div><div class="">Thanks for the help,</div><div class="">  Johan</div><div class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Oct 3, 2016 at 4:45 PM, Teresa Johnson <span dir="ltr" class=""><<a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Oh sorry, misunderstood and thought you were implementing in a new linker. For gold you can pass -Wl,-plugin-opt,save-temps and look at the bitcode after each phase of ThinLTO, e.g. I think the files will have .3.import.bc extensions.<span class="m_2981833881305647625HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Teresa</div></font></span></div><div class="gmail_extra"><div class=""><div class="m_2981833881305647625h5"><br class=""><div class="gmail_quote">On Mon, Oct 3, 2016 at 7:42 AM, Johan Engelen <span dir="ltr" class=""><<a href="mailto:jbc.engelen@gmail.com" target="_blank" class="">jbc.engelen@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Oct 3, 2016 at 4:27 PM, Teresa Johnson <span dir="ltr" class=""><<a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="m_2981833881305647625m_-2678425756575116267m_4773286970547948026gmail-">On Mon, Oct 3, 2016 at 6:53 AM, Johan Engelen via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Hi all,<div class="">  I am trying to add ThinLTO to the LDC compiler. It seems to work well on Mac (XCode 8) and Ubuntu (ld.gold + LLVMgold plugin).</div><div class="">However, I am running into trouble with module-scope inline assembly blocks.</div></div></blockquote><div class=""><br class=""></div></span><div class="">Are you adding the support using the new LTO API or using the libLTO C interfaces?</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Perhaps I don't fully understand, but I think the answer is: neither :)</div><div class="">What I do is output the module as bitcode with the module summary index added (`llvm::WriteBitcodeToFile`, summary index created with `llvm::ModuleSummaryIndexBuild<wbr class="">er`). This is then passed to the system linker. The problems arise with ld.gold + LLVMgold plugin. I am using LLVM 3.9.0.</div><div class=""><br class=""></div></div></div></div>
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div></div></div><span class="">-- <br class=""><div class="m_2981833881305647625m_-2678425756575116267gmail_signature" data-smartmail="gmail_signature"><span style="font-family: Times; font-size: inherit;" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class=""><td nowrap="" style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class=""> Software Engineer |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class=""> <a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class=""> <a href="tel:408-460-2413" value="+14084602413" target="_blank" class="">408-460-2413</a></td></tr></tbody></table></span></div>
</span></div>
</blockquote></div><br class=""></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>