[TTI] Remove getOperationCost
authorSam Parker <sam.parker@arm.com>
Thu, 9 Apr 2020 06:41:18 +0000 (07:41 +0100)
committerSam Parker <sam.parker@arm.com>
Tue, 21 Apr 2020 08:15:34 +0000 (09:15 +0100)
commitee959ddc5eee180f75851649d01260a4f0ba5198
tree3c3feaa2898a71e7ae0ec09909360091a80d28cc
parente90fb82f0f760703c14eafbad96c08b6019a2f0f
[TTI] Remove getOperationCost

This API call has been used recently with, a very valid, expectation
that it would do something useful but it doesn't actually query any
backend information. So, remove this method and merge its
functionality into getUserCost. As well as that, also use
getCastInstrCost to get a proper cost from the backend for the
concerned instructions though we only currently return the answer if
it's considered free. The default implementation now also checks
int/ptr conversions too, as well as truncs and bitcasts.

Differential Revision: https://reviews.llvm.org/D76124
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp