[llvm] [SLP] Let the caller tell canConvertToFMA which operand holds the fmul (PR #218754)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 14:16:18 PDT 2026


================

----------------
alexey-bataev wrote:

```suggestion
          FMF &= FPCI->getFastMathFlags();
          // Copyable lanes may not be fadd/fsub; only those carry an fmul
          // operand index.
          unsigned MulOp = isa<BinaryOperator>(FPCI) && E->isCopyableElement(V)
                               ? 0
                               : getFMulOperandIdx(FPCI);
          if (auto *FPCIOp = dyn_cast<FPMathOperator>(FPCI->getOperand(MulOp)))
            FMF &= FPCIOp->getFastMathFlags();
```

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


More information about the llvm-commits mailing list