<div dir="ltr">Also meant to ask whether there was a way to avoid passing in a constant from the two callers and then conditionalizing later. It'd be nice to just bubble up the behavior and do it in the place that needs it and not do it in the place that doesn't.<br><br>Not sure if that's possible/practical (I see it overlaps with the 'minimal' flag, which makes it trickier) - but I'll give it some more thought.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 1, 2016 at 2:38 PM, David Blaikie via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dblaikie added a comment.<br>
<br>
Got data on how much this grows the size of output (optimized clang selfhost, perhaps?)<br>
<br>
I've had a few conversations about where linkage names should and should not appear, and have yet to understand/hear a coherent position about what consumers want to use them for. Perhaps you could outline your use case, so we can at least think about how that applies across LLVM?<br>
<br>
<br>
================<br>
Comment at: test/DebugInfo/Generic/linkage-name-abstract.ll:10-16<br>
@@ +9,9 @@<br>
+; IR generated from clang -O0 with:<br>
+; int i = 2;<br>
+; __attribute__((always_inline)) int foo() {<br>
+;   return i;<br>
+; }<br>
+; int bar() {<br>
+;   return 1 + foo();<br>
+; }<br>
+<br>
----------------<br>
If you're demonstrating inlining, I find this to be the simplest option:<br>
<br>
  void f1();<br>
  __attribute__((always_inline)) void f2() {<br>
    f1();<br>
  }<br>
  void f3() {<br>
    f2();<br>
  }<br>
<br>
That way there's no confusion about whether the return values are relevant, if the operations (like addition) are relevant, if an optimization could constant propagate/fold away the value, etc. The call to f1 is unoptimizable, can't be coalesced with anything, etc.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D18706" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18706</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>