[LLVMdev] TargetLowering vs. TargetTransform

Renato Golin renato.golin at linaro.org
Sat Jan 26 05:16:57 PST 2013

On 25 January 2013 23:03, Nadav Rotem <nrotem at apple.com> wrote:

> Yes. This is a limitation of the current API.  The design decision behind
> it was that in many cases you want to know the cost of IR before you
> generate it.

That makes sense.

Also, we wanted to rely on tables as much as possible. We did not want to
> write code to resemble ISel in order to estimate the cost. Is this
> something that we can live with ?

It depends on the final design intentions. If these costs are only ever
going to be used by the vectorization, or if other optimizations are going
to start using TargetTransformInfo for cost information, than yes, it makes
sense to begin focusing cost models on TTI. But if other passes call TL
directly, then we might re-think the strategy.

It looks to me that only lowering would need to call TL's costs, since they
can be different than a more high level cost, and possibly assume that the
code is already valid and checked, which is not the case for most
transformations, including the vectorization. I think this is more or less
what you were saying before.

I'll give it a few tries and send to the list so we can discuss with more
concrete implementations.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130126/db160fb4/attachment.html>

More information about the llvm-dev mailing list