[llvm] [CostModel] Remove some negative costs. (PR #135533)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 14 01:32:21 PDT 2025


davemgreen wrote:

> Why not use InstructionCost::getInvalid() ?

An Insert I would not expect to be invalid, and for the one at the end of getInstructionCost, if it can return a valid cost for !Recip returning the same cost as a fallback sounded OK to me. An Invalid cost to me means "this cannot be codegenerated" (or maybe just "strongly don't do this" at times), not "I don't know".

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


More information about the llvm-commits mailing list