[LLVMdev] CostModel analysis -- what is its actual purpose?

Chandler Carruth chandlerc at gmail.com
Sun Feb 1 01:24:17 PST 2015


Greetings,

So the CostModel 'analysis' today isn't actually an analysis at all. It is
one of the only analyses which doesn't even have an interface available
outside of the .cpp file, so it is literally impossible to use it today.

The only use is to form tests of TargetTransformInfo, but if that's really
the only intent, then I have two somewhat large questions:

1) Why isn't this just the implementation of the print method for TTI?
Should I make it into that?

2) Why is there so much logic in it? This doesn't really seem like it's
*just* testing TTI, it almost seems its duplicating some logic in the
vectorizers to ensure that logic behaves correctly.... But if so, that
logic should really be de-duplicated into an actual analysis with an API
that is used by the vectorizers...

Anyways, I'm asking because I've ported TTI to the new pass manager, but it
the testing is quite weak. I can port CostModel as well, but I don't really
know what the right port is given that it is an analysis which can only be
used to print things.

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


More information about the llvm-dev mailing list