[PATCH] D24338: [InlineCost] Remove CallPenalty and change MinSizeThreshold to 5

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 20:06:24 PDT 2016


mehdi_amini added a comment.

(Add inline the answer to David, so that there is the relevant context)



================
Comment at: lib/Analysis/InlineCost.cpp:938
-      if (!isa<InlineAsm>(CS.getCalledValue()))
-        Cost += InlineConstants::CallPenalty;
     }
----------------
>>! In D24338, @davidxl wrote:
> Do you mean parameter passing? That should be counted independently  by the instruction visitor.

No, I don’t mean the parameters, the visitor account for one instruction per parameter just before this indeed.
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.

In this sense, it make sense that a call can "cost" more than a normal instruction.


Repository:
  rL LLVM

https://reviews.llvm.org/D24338





More information about the llvm-commits mailing list