[llvm-dev] FMA canonicalization in IR

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 19 08:26:17 PST 2016


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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161119/4e6d52e5/attachment.html>


More information about the llvm-dev mailing list