[llvm] [InstCombine] Canonicalize reassoc contract fmuladd to fmul + fadd (PR #90434)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 06:12:49 PDT 2024
vfdff wrote:
* test: https://gcc.godbolt.org/z/bhj9zaxW8
```
double fnmadd( double a[], double b[], double c[], int n)
{
double d = 0.0;
for (int i=0; i<n; i++)
d += a[i] * c[i] + b[i];
return d;
}
```
- Thank you @arsenm for your clarification. I also tested above case, and it only generate **@llvm.fmuladd.v2f64** when there is **no -ffast-math** option, so I think that is what @andykaylor expected, ie: clang should not generate the llvm.fmuladd intrinsic in the fp-contract=fast state, and **fast @llvm.fmuladd.v2f64** in IR is also not expected? not only the **contract @llvm.fmuladd.v2f64** ?
https://github.com/llvm/llvm-project/pull/90434
More information about the llvm-commits
mailing list