[llvm] [RISCV] Handle zvfhmin and zvfbfmin promotion to f32 in half arith costs (PR #108361)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 10:34:11 PDT 2024


================
@@ -1908,6 +1908,13 @@ InstructionCost RISCVTTIImpl::getArithmeticInstrCost(
     return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info, Op2Info,
                                          Args, CxtI);
 
+  // f16 with zvfhmin and bf16 will be promoted to f32.
----------------
lukel97 wrote:

My thinking was that given a sequence of [b]f16 ops we're probably only going to need to extend it and truncate it once. So adding that to the cost of every single arithmetic instruction seems like it would overestimate it too much.

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


More information about the llvm-commits mailing list