[llvm] [RISCV][TTI] Support fdiv/udiv/sdiv/srem/urem in getArithmeticInstrCost (PR #89170)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 15:47:15 PDT 2024


================
@@ -1612,29 +1612,58 @@ InstructionCost RISCVTTIImpl::getArithmeticInstrCost(
   if (Op2Info.isConstant())
     ConstantMatCost += getConstantMatCost(1, Op2Info);
 
+  // Assuming instructions falling through the switch-cases have the same cost
----------------
topperc wrote:

I don't think "falling through" is the correct term here. That kind of implies there is a `[fallthrough]` in the switch. Maybe put this in the `default:` case as

```
Assuming all other instructions have the same cost until a need arises to differentiate them.
```

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


More information about the llvm-commits mailing list