Hi all, I'm looking for a place where to put the costs of vector (and scalar) cast operations for ARM, but I noticed the TargetTransform methods call the TargetLowering ones when unsure. Now, I'm not sure... Many casts on ARM are free, and I could build a list of cases where it is true, but should I put this on the lowering or the transform? My main motivation is to get the costs right for the vectorization pass, but I think this should be generally available to any pass that needs it. What are the uses of each and, is there a general rule of thumb for using them? cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130125/a7b8afcc/attachment.html>
Hi Renato, I think that we need to improve ::isTruncateFree, ::isZextFree, etc to include all of the free conversions. Vector and Scalar. Non-free conversions are marked with setOperationAction so the generic parts of TTI should be able to give a reasonable cost estimation. The cost tables should contain cases that are not handled by TTI. So, if we have a clever DAGCombine optimization (that TLI can't detect because it is not in the operations table) then we need to add it to the cost table. Thanks, Nadav On Jan 25, 2013, at 8:21 AM, Renato Golin <renato.golin at linaro.org> wrote:> Hi all, > > I'm looking for a place where to put the costs of vector (and scalar) cast operations for ARM, but I noticed the TargetTransform methods call the TargetLowering ones when unsure. > > Now, I'm not sure... > > Many casts on ARM are free, and I could build a list of cases where it is true, but should I put this on the lowering or the transform? My main motivation is to get the costs right for the vectorization pass, but I think this should be generally available to any pass that needs it. > > What are the uses of each and, is there a general rule of thumb for using them? > > cheers, > --renato
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 isZExtFree? 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? cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130125/363135e2/attachment.html>
Reasonably Related Threads
- [LLVMdev] TargetLowering vs. TargetTransform
- [LLVMdev] TargetLowering vs. TargetTransform
- [LLVMdev] TargetLowering vs. TargetTransform
- [LLVMdev] TargetLowering vs. TargetTransform
- [LLVMdev] [llvm-commits] [patch] "TargetTransform" as an API between codegen and IR-level passes