[LLVMdev] TargetLowering vs. TargetTransform

Renato Golin renato.golin at linaro.org
Fri Jan 25 14:00:53 PST 2013

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

> I think that we need to improve ::isTruncateFree, ::isZextFree, etc to
> include all of the free conversions. Vector and Scalar.

Hi Nadav,

Yes, and the question is: TargetLowering's isZExtFree or TargetTransform's

TargetTransform (TT) only has the free checks on types, while
TargetLowering (TL) has on SDValue and destination type.

For my purposes, I need the operation information, so I was going to
implement on TL, but I can't see where the TT queries that, though BasicTTI
queries isTruncateFree(Type, Type), which is not the one I want to override.

Do you see the confusion?

Some truncates are not free (16-bit results have to move to D* first), so I
could just assume this is the case by type, but I wanted to limit to the
arithmetic operations, not loads and stores, that have their own halving
and doubling that are, sometimes, free.

But since TT already lost the information on the operations (passing only
the type), I can't reach that info. And since ARMTTI is supposed to only
apply the exceptions, I didn't want to override it on that.

Am I making any sense?

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

More information about the llvm-dev mailing list