<div dir="ltr">You should use "opt" with -inline, or -O2/3 to optimise this. <div>llc only runs backend optimisations.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 1 December 2013 18:51, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry for what may possibly be a rather stupid question, but how on earth do you make LLC inline a function? I've got this code:<div>
<br></div><div>
<pre style="font-size:14pt;font-family:Consolas"> attributes 0 = { alwaysinline nounwind }
define internal i32 @lambda(i32 %a, i32 %x) #0 {
%1 = add i32 %a, %x
ret i32 %1
}
define i32 @foo(i32 %a) nounwind {
%1 = call i32 @lambda(i32 %a, i32 10)
ret i32 %1
}
</pre><pre><font face="arial"><span style="white-space:normal">And no matter what I do, the function @lambda ends up being called with a call instruction. I've tried with -O2, -O3, and with and without the alwaysinline attribute.</span></font></pre>
<pre>How do I get LLC or Clang to inline the above @lambda function?</pre><pre>Thanks in advance!</pre><span class="HOEnZb"><font color="#888888"><pre><br></pre><pre>-- Mikael</pre><pre style="font-size:14pt;font-family:Consolas">
<br></pre></font></span></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>