[LLVMdev] TargetLowering vs. TargetTransform
nrotem at apple.com
Sat Jan 26 21:14:36 PST 2013
On Jan 26, 2013, at 5:16 AM, Renato Golin <renato.golin at linaro.org> wrote:
> 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.
IR passes should only use TTI. This deserves a separate thread, but the idea is that 'lowering IR passes' such as the Vectorizers, LSR and CodegenPrepare will use TTI. Canonicalization transformations such as InstCombine and SimplifyCFG will not use TTI. Some canonicalization passes such as the Inliner may use a very small subset of TTI (the inliner can estimate the size of instructions, but this is still a canonicalization). A few of us are working on a proposal to formalize it.
> 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.
Yes, TargetLowering is used directly only by the codegen (and TTI).
> 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...
More information about the llvm-dev