<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 1, 2016 at 8:06 PM, Mehdi AMINI <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mehdi_amini added a comment.<br>
<br>
(Add inline the answer to David, so that there is the relevant context)<br>
<br>
<br>
<br>
================<br>
Comment at: lib/Analysis/InlineCost.cpp:93<wbr>8<br>
-      if (!isa<InlineAsm>(CS.getCalledV<wbr>alue()))<br>
-        Cost += InlineConstants::CallPenalty;<br>
     }<br>
----------------<br>
<span>>>! In D24338, @davidxl wrote:<br>
> Do you mean parameter passing? That should be counted independently  by the instruction visitor.<br>
<br>
</span>No, I don’t mean the parameters, the visitor account for one instruction per parameter just before this indeed.<br>
However a call has other extra-cost on top of a regular instruction, even without any argument: it splits live-ranges and may cause spills around it to preserve registers that aren't callee-saved.<br>
<br>
In this sense, it make sense that a call can "cost" more than a normal instruction.<br></blockquote><div><br></div><div>yes, inlining can lead to increased register pressure leading to use of caller save registers (and spills around new callsites). However I think this should not be blindly applied -- better tied with register pressure analysis.</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="m_-6265418196936449837HOEnZb"><div class="m_-6265418196936449837h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D24338" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2433<wbr>8</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>