If I have my FMA intrinsics story straight now (thanks for the explanation, Hal!), I think it raises another question about IR canonicalization (and may affect the proposed revision to IR FMF):
define float @foo(float %a, float %b, float %c) {
%mul = fmul fast float %a, %b ; using ‘fast’ because there is no ‘fma’ flag
%add = fadd fast float %mul, %c
ret float %add
}
Should this be:
define float @goo(float %a, float %b, float %c) {
%maybe.fma = call fast float @llvm.fmuladd.f32(float %a, float %b, float %c)
ret float %maybe.fma
}
declare float @llvm.fmuladd.f32(float %a, float %b, float %c)