[CostModel] Generic equal type cost model partial reduce (#229426)
When trying to enable partial reductions as a default reduction step in
#228481, a regression was found where a loop that would have been
unrolled if the steps were plain add instructions no longer unrolled.
This is due to inaccurate costs in the default path, especially for code
size.
This updates the basic TTI cost functions to return the cost of the
equivalent arithmetic instruction in the case the input and accumulator
types are the same, otherwise falls back to querying the backend with an
ISD opcode.
GitOrigin-RevId: fe882c6fca75e167a665a1943a38a2cc2229fea6
5 files changed