<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 24, 2021 at 3:14 PM Arthur Eubanks via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><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">Looks like the secondary split LTO units (e.g. due to -fwhole-program-vtables) are being added together into one large module which is then monolithically LTO'd, which is where the extra passes were being run.</div></blockquote><div><br></div><div>Right. Note you can run WPD in ThinLTO only mode by passing -fno-split-lto-unit, which is a little less powerful in terms of optimization (can't do virtual constant prop, although I'm not sure how often this kicks in), and doesn't support CFI. Internally for our ThinLTO builds when performing WPD for optimization (i.e. without CFI) we disable the splitting for compile time scalability reasons.</div><div><br></div><div>Teresa</div><div><br></div><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"><div><br></div><div>splitAndWriteThinLTOBitcode():<br></div><div>  // Mark the merged module as requiring full LTO. We still want an index for<br>  // it though, so that it can participate in summary-based dead stripping.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 24, 2021 at 12:32 PM Arthur Eubanks <<a href="mailto:aeubanks@google.com" target="_blank">aeubanks@google.com</a>> wrote:<br></div><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">Ah I messed something up locally, removing the regular LTO run causes undefined hidden symbol errors for vtables.<div>The `runRegularLTO()` name is confusing though, it apparently sets up some things necessary for ThinLTO.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 24, 2021 at 11:58 AM Arthur Eubanks <<a href="mailto:aeubanks@google.com" target="_blank">aeubanks@google.com</a>> wrote:<br></div><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"><div>While debugging a ThinLTO issue, I noticed that passes were running more often than I expected. This is being invoked pretty normally, something like</div><div><font face="monospace">$ clang++ -fuse-ld=lld -flto=thin</font></div><div><br></div><div>Looks like at [1] we try to first run regular LTO before running ThinLTO. Removing the first line makes the link go from 208s to 115s. Is this expected behavior?</div><div><br></div>[1]: <a href="https://github.com/llvm/llvm-project/blob/a64ebb8637277998f77e55d335faca6fdcf5859b/llvm/lib/LTO/LTO.cpp#L1033" target="_blank">https://github.com/llvm/llvm-project/blob/a64ebb8637277998f77e55d335faca6fdcf5859b/llvm/lib/LTO/LTO.cpp#L1033</a><br></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><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 nowrap style="border-top:2px solid rgb(213,15,37)">Teresa Johnson |</td><td nowrap style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td><td nowrap style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top:2px solid rgb(238,178,17)"><br></td></tr></tbody></table></span></div></div></div></div>