<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Nov 26, 2016 at 11:31 PM Sean Silva via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">silvas created this revision.<br class="gmail_msg">
silvas added reviewers: ruiu, rafael.<br class="gmail_msg">
silvas added a subscriber: llvm-commits.<br class="gmail_msg">
silvas set the repository for this revision to rL LLVM.<br class="gmail_msg">
<br class="gmail_msg">
This function is incredibly hot (it is called unconditionally for every relocation) and so we need everything the compiler can give us for it. It is just a helper anyway.<br class="gmail_msg">
<br class="gmail_msg">
This change is good for 3-4% speedup on clang-fsds with `ld.lld -O1`.<br class="gmail_msg">
<br class="gmail_msg">
The compiler that needed this identifies itself as `gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609`<br class="gmail_msg"></blockquote><div><br></div><div>Is it important to optmize our code for this compiler? My general understanding was that we mostly focus on selfhost perf for LLVM projects - correctness everywhere, then just bootstrap to get good perf. That way we can just fix compiler bugs in the compiler rather than both in the compiler and in the project source.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also, this will allow us in the future to more accurately assess the benefits of PGO for building LLD. If we can get this speedup easily without PGO by just applying an attribute, we don't want this 3-4% to inflate the benefit of PGO when we try PGO.<br class="gmail_msg"></blockquote><div><br></div><div>I'm not sure that's necessarily an inflation (though if LLVM is missing this inline opportunity that it should be getting even without PGO, etc - then we should fix LLVM) - I think PGO should help LLVM get situations like this that a user /could/ fix, but finding and fixing them all is expensive/not practical overall, so having a tool that can get them for you is valuable.<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
Repository:<br class="gmail_msg">
  rL LLVM<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D27147" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27147</a><br class="gmail_msg">
<br class="gmail_msg">
Files:<br class="gmail_msg">
  ELF/Relocations.cpp<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Index: ELF/Relocations.cpp<br class="gmail_msg">
===================================================================<br class="gmail_msg">
--- ELF/Relocations.cpp<br class="gmail_msg">
+++ ELF/Relocations.cpp<br class="gmail_msg">
@@ -421,10 +421,10 @@<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
 template <class ELFT><br class="gmail_msg">
-static RelExpr adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &Body,<br class="gmail_msg">
-                          bool IsWrite, RelExpr Expr, uint32_t Type,<br class="gmail_msg">
-                          const uint8_t *Data, InputSectionBase<ELFT> &S,<br class="gmail_msg">
-                          typename ELFT::uint RelOff) {<br class="gmail_msg">
+LLVM_ATTRIBUTE_ALWAYS_INLINE static inline RelExpr<br class="gmail_msg">
+adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &Body, bool IsWrite,<br class="gmail_msg">
+           RelExpr Expr, uint32_t Type, const uint8_t *Data,<br class="gmail_msg">
+           InputSectionBase<ELFT> &S, typename ELFT::uint RelOff) {<br class="gmail_msg">
   bool Preemptible = isPreemptible(Body, Type);<br class="gmail_msg">
   if (Body.isGnuIFunc()) {<br class="gmail_msg">
     Expr = toPlt(Expr);<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div></div>