[LLVMdev] Can someone remind me why ScalarTargetTransformInfo and VectorTargetTransformInfo are separate?

Nadav Rotem nrotem at apple.com
Fri Jan 4 21:11:29 PST 2013

On Jan 4, 2013, at 8:12 PM, Chandler Carruth <chandlerc at google.com> wrote:

> I remember this being discussed, and may have even supported it, but I'm looking at cleaning up some of how the target transform info works, and it would be a lot less duplicate boiler-plate code to only have one.

The original idea was that different transformations would have different interfaces. For example the vectorizers would use the VectorTTI,  the LSR would use the Scalar TTI, etc.  We did not want to create yet another TargetLowering interface with lots of functions in it.  

> Having a narrower interface doesn't seem to make a lot of sense in this case because for the users, there is no real cost, and for the implementors, they always have to implement both and do so in the same location.
> If not shout out with a compelling reason why they should be separate, I'll merge them really soon... It will simplify quite a few things.

I don't object merging the two interfaces.  if at some point in the future we need to add a new interface (for example for exposing register information) then we can add the new interface. 

More information about the llvm-dev mailing list