[LLVMdev] Instruction Cost

Jingyue Wu jingyue at google.com
Wed Jan 14 15:54:26 PST 2015


Hi,

I'm looking for APIs that compute instruction costs, and noticed several of
them.

1. A series of APIs of TargetTransformInfo that compute the cost of
instructions of a particular type (e.g. getArithmeticInstrCost and
getShuffleCost)
2. TargetTransformInfo::getOperationCost
3. CostModel::getInstructionCost::getInstructionCost in
lib/Analysis/CostModel.cpp

Only the first one is used extensively in LLVM's code base, but the second
and third one seems more recently added and more general, making me think
if they are designed to replace the first approach.

So, what's the recommended way to compute instruction costs?

Thanks,
Jingyue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150114/e22d8e10/attachment.html>


More information about the llvm-dev mailing list