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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 13:18:00 PDT 2024


arsenm wrote:

> > For more precise costs the target can override getIntrinsicInstrCost.
> 
> I'm not sure I follow why intrinsics would/should be more precise? In this case, doesn't the intrinsic map directly to the ISD node?

Because to compute an exact cost you need to know the exact expansion is going to use. The current code assumes a specific expansion, adds up the costs of those pieces. This overestimate the cost when the underlying operation is actually legal. The default cost for an arbitrary expand ISD opcode is some fixed constant 

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


More information about the llvm-commits mailing list