<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 3, 2016, 8:08 AM Johan Engelen <<a href="mailto:jbc.engelen@gmail.com">jbc.engelen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" id="gmail_block_quote0"><div dir="ltr" class="gmail_msg">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></blockquote></div><div>What revision is your gold plugin built from? I would expect more temp files.</div><div> </div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" id="gmail_block_quote1"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">The `a.thinlto.bc` file contains nothing, only `source_filename = ...` .</div></div></blockquote></div><div>This is a dump of the combined index. llvm-dis won't show that, so that's not unexpected.</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" id="gmail_block_quote2"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">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><div dir="ltr" class="gmail_msg"><div class="gmail_msg">```</div><div class="gmail_msg"><div class="gmail_msg">module asm "\09.text"</div><div class="gmail_msg">module asm "\09.globl\09foo"</div><div class="gmail_msg">module asm "\09.align\0916, 0x90"</div><div class="gmail_msg">module asm "\09.type\09foo,@function"</div><div class="gmail_msg">module asm "foo:"</div><div class="gmail_msg">module asm "\09movq %rdi, %rax"</div><div class="gmail_msg">module asm "\09rorw $8, %ax"</div><div class="gmail_msg">module asm "\09ret "</div><div class="gmail_msg">module asm "\09.size\09foo, .-foo"</div><div class="gmail_msg">module asm ""</div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg">```</div><div class="gmail_msg">The asm is the same as in the other module (where it _should_ be defined), and the linkage has not been changed.</div></div></blockquote></div><div><br></div><div>Will try to reproduce later this morning when I'm back in front of my computer. </div><div><br></div><div>Teresa</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" id="gmail_block_quote3"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks for the help,</div><div class="gmail_msg">  Johan</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Mon, Oct 3, 2016 at 4:45 PM, Teresa Johnson <span dir="ltr" class="gmail_msg"><<a href="mailto:tejohnson@google.com" class="gmail_msg" target="_blank">tejohnson@google.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">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_3344665258386519714m_2981833881305647625HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Teresa</div></font></span></div><div class="gmail_extra gmail_msg"><div class="gmail_msg"><div class="m_3344665258386519714m_2981833881305647625h5 gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Mon, Oct 3, 2016 at 7:42 AM, Johan Engelen <span dir="ltr" class="gmail_msg"><<a href="mailto:jbc.engelen@gmail.com" class="gmail_msg" target="_blank">jbc.engelen@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><span class="gmail_msg">On Mon, Oct 3, 2016 at 4:27 PM, Teresa Johnson <span dir="ltr" class="gmail_msg"><<a href="mailto:tejohnson@google.com" class="gmail_msg" target="_blank">tejohnson@google.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><span class="m_3344665258386519714m_2981833881305647625m_-2678425756575116267m_4773286970547948026gmail- gmail_msg">On Mon, Oct 3, 2016 at 6:53 AM, Johan Engelen via llvm-dev <span dir="ltr" class="gmail_msg"><<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi all,<div class="gmail_msg">  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="gmail_msg">However, I am running into trouble with module-scope inline assembly blocks.</div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></span><div class="gmail_msg">Are you adding the support using the new LTO API or using the libLTO C interfaces?</div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></span><div class="gmail_msg">Perhaps I don't fully understand, but I think the answer is: neither :)</div><div class="gmail_msg">What I do is output the module as bitcode with the module summary index added (`llvm::WriteBitcodeToFile`, summary index created with `llvm::ModuleSummaryIndexBuilder`). 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="gmail_msg"><br class="gmail_msg"></div></div></div></div>
</blockquote></div><br class="gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div></div><span class="gmail_msg">-- <br class="gmail_msg"><div class="m_3344665258386519714m_2981833881305647625m_-2678425756575116267gmail_signature gmail_msg" data-smartmail="gmail_signature"><span style="font-family:Times;font-size:medium" class="gmail_msg"><table cellspacing="0" cellpadding="0" class="gmail_msg"><tbody class="gmail_msg"><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class="gmail_msg"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="gmail_msg">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class="gmail_msg"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class="gmail_msg"> <a href="mailto:tejohnson@google.com" class="gmail_msg" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class="gmail_msg"> <a href="tel:408-460-2413" value="+14084602413" class="gmail_msg" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</span></div>
</blockquote></div><br class="gmail_msg"></div></div></blockquote></div>