<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Aug 10, 2018 at 2:14 PM Teresa Johnson <<a href="mailto:tejohnson@google.com">tejohnson@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 6, 2018 at 5:24 PM Quentin Colombet <<a href="mailto:quentin.colombet@gmail.com" target="_blank">quentin.colombet@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I believe the ordering should be deterministic between two runs, but<br>
not necessarily in the order of the input files.<br>
<br>
That said, Steven's answer is probably more interesting to you:<br>
> For both thinLTO and fullLTO, there exists APIs to write object file output before sending it to the linker. Depending on which linker you use, linker might provide you with different options.<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>(Sorry for the slow reply, just back from vacation). Quentin and Steven's answers are correct. For the gold linker, you can use -Wl,-plugin-opt=save-temps to get the bitcode at various stages of LTO for both Thin and regular LTO. For regular LTO the output files will be at the output file path, and for ThinLTO there will be a set for each input bitcode module, at the input file's path. They end in .bc and the suffixes include the name of the phase (i.e. "preopt.bc" for the files at the start of LTO.</div></div></div><div dir="ltr"><div class="gmail_quote"><div><br></div></div></div></blockquote><div>Okay, thanks. I'll see if I can work around the issue with these options.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2018-08-06 16:52 GMT-07:00 Bill Wendling <<a href="mailto:isanbard@gmail.com" target="_blank">isanbard@gmail.com</a>>:<br>
> On Mon, Aug 6, 2018 at 4:30 PM Quentin Colombet <<a href="mailto:quentin.colombet@gmail.com" target="_blank">quentin.colombet@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi Bill,<br>
>><br>
>><br>
>> 2018-08-06 16:13 GMT-07:00 Bill Wendling via llvm-dev<br>
>> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br>
>> > Is there a way to get object files from the LTO step before the linker<br>
>> > performs the final link phase? What I'd like to do is given these<br>
>> > bitcode<br>
>> > files:<br>
>> ><br>
>> >   a.lto.o, b.lto.o, c.lto.o<br>
>> ><br>
>> > run LTO on them and get out the object files:<br>
>> ><br>
>> >   a.o, b.o, c.o<br>
>> ><br>
>> > (These .o files hold the code that is sent directly to the final link<br>
>> > phase.)<br>
>> ><br>
>> > If there doesn't currently exist a way, is such a thing possible?<br>
>><br>
>> I don't think that's possible, because basically the LTO pipeline will<br>
>> put all the input files into one module and we have no way to track<br>
>> back what came from what, nor it made much sense after LTO does<br>
>> inlining and such.<br>
>> That said, for thin-LTO we may still have some of the information around.<br>
>><br>
>> + Teresa, she should know.<br>
>><br>
> That's what I feared might be the answer. Another question then, would the<br>
> function ordering be deterministic? I.e., if a.o had functions "foo", "bar",<br>
> and "baz", and b.o had functions "mux", "nux", and bork", would the function<br>
> order before it went off to the final link phase be:<br>
><br>
>   foo, bar, baz, mux, nux, bork<br>
><br>
> (This assumes that none of those functions were inlined or otherwise<br>
> deleted.)<br>
><br>
> -bw<br>
</blockquote></div></div><div dir="ltr"><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-4906911529778725333m_2063809275096629439m_-1805214175054774514gmail_signature" data-smartmail="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:(408)%20460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div></div></blockquote></div></div>