[llvm] TTI: Fix special casing vectorization costs of saturating add/sub (PR #97463)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 02:19:27 PDT 2024


davemgreen wrote:

We have overrides for legal operations in ARMTTIImpl::getIntrinsicInstrCost and AArch64TTIImpl::getIntrinsicInstrCost. If the operation gets expanded we should be producing some cost of what the (default) expansion cost is likely to be though, much like abs or min/max above.

I believe the logic should be:
 - If the ISD operations is legal or promote -> treat it as cheap.
 - else use the cost of the expanded form.

It is similar to how fmuladd is performed at the moment. For more precise costs the target can override getIntrinsicInstrCost.

https://github.com/llvm/llvm-project/pull/97463


More information about the llvm-commits mailing list