[llvm] [SLP] Fix canConvertToFMA fmul costing (PR #216425)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 17:54:21 PDT 2026


================
@@ -14489,16 +14489,40 @@ static InstructionCost canConvertToFMA(ArrayRef<Value *> VL,
   // Compare the costs.
   InstructionCost FMulPlusFAddCost = 0;
   InstructionCost FMACost = 0;
+  // Price the fmul as not fused with its user. Passing a context instruction
+  // would let targets that model the fusion discount the unfused side of the
+  // comparison as well.
----------------
alexey-bataev wrote:

```suggestion
  // Price both sides of the fmul+fadd pair as not fused. Passing a context
  // instruction would let targets that model the fusion discount the unfused
  // side of the comparison as well.
```

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


More information about the llvm-commits mailing list