[LLVMdev] Instruction Cost

Hal Finkel hfinkel at anl.gov
Wed Jan 14 17:04:37 PST 2015


----- Original Message -----
> From: "Sanjay Patel" <spatel at rotateright.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Jingyue Wu" <jingyue at google.com>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Wednesday, January 14, 2015 7:00:57 PM
> Subject: Re: [LLVMdev] Instruction Cost
> 
> 
> 
> 
> 
> 
> On Wed, Jan 14, 2015 at 5:08 PM, Hal Finkel < hfinkel at anl.gov >
> wrote:
> 
> 
> > 1. A series of APIs of TargetTransformInfo that compute the cost of
> > instructions of a particular type (e.g. getArithmeticInstrCost and
> > getShuffleCost)
> 
> These are used by the vectorizers, and roughly, return costs in
> reciprocal throughput (the higher the throughput the lower the
> cost).
> 
> 
> 
> Do you think we could replace this with data from the CPU scheduling
> models (if it exists in a particular CPU's model)?

In part, but you'd still need a mapping from IR -> MI instruction(s). You might be able to derive this from the TableGen patterns, but that will only work for simple things (likely not shuffles, for example).

 -Hal

> 
> 
> One number for all CPUs may not always be adequate:
> 
> http://llvm.org/bugs/show_bug.cgi?id=21356
> 
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list