<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 29, 2015 at 7:43 AM, Amjad Aboud 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">aaboud marked an inline comment as done.<br>
<span class=""><br>
================<br>
Comment at: test/DebugInfo/imported_entities.ll:12<br>
@@ +11,3 @@<br>
+;; This test was generated by running following command:<br>
+;; clang -cc1 -O0 -g -emit-llvm test.cpp -o - | opt -S -inline -sroa<br>
+;; Where test.cpp<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> Why do you need SROA here?<br>
</span>It makes the LLVM IR simpler by removing the "lifetime" intrinsic that is added by the "-inline" pass.<br>
Other than that it is not needed.<br>
<br>
Anyway, once I use the "always_inline" attribute you suggested, there is no need for "-inline" nor "-soa" passes.<br>
<span class=""><br>
================<br>
Comment at: test/DebugInfo/imported_entities.ll:19<br>
@@ +18,3 @@<br>
+;;<br>
+;;static inline int foo(bool b) {<br>
+;;  using namespace NameSpace;<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> I usually write these tests by using __attribute__((always_inline)) then even at -O0 clang will run LLVM's AlwaysInliner and inline this, rather than relying on the normal inliner choosing to inline the function.<br>
</span>Turned to be a better way to write the test.<br>
I just needed to keep the static, so clang can get rid of the inlined function once it inline it.<br></blockquote><div><br></div><div>Hmm, that shouldn't be necessary - in C++ an inline function, once inlined into all the call sites, should be removed/omitted entirely by the optimizers, even at -O0. Oh, so long as the function is marked inline - so inline or static would be needed (in addition to the always_inline attribute, in either case), not both. I usually use inline, but I'm not especially wedded to it or anything.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D12913" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12913</a><br>
<br>
<br>
<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br></div></div>