[llvm-bugs] [Bug 17229] x86 FMA could choose different instruction to avoid move

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 1 09:59:55 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=17229

Kay Tiong Khoo <kkhoo at perfwizard.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #9 from Kay Tiong Khoo <kkhoo at perfwizard.com> ---
Reopening: -ffast-math shouldn't be necessary. 

Testing with clang built from r254421, the test case in comment 2 looks good,
but the original test case has not changed:

$ cat 17229.c 
#pragma STDC FP_CONTRACT ON
double foo(double x, double y, double z) {
    return y*z + x;
}
double foo2(double x, double *y, double z) {
  return (*y)*z + x;
}

$ ./clang -S -O1 -fomit-frame-pointer -march=haswell -o - 17229.c |grep xmm
    vfmadd213sd    %xmm0, %xmm2, %xmm1
    vmovaps    %xmm1, %xmm0
    vfmadd231sd    (%rdi), %xmm1, %xmm0

Note that FP_CONTRACT ON was made the clang default in:
http://llvm.org/viewvc/llvm-project?view=revision&revision=253269
but reverted in:
http://llvm.org/viewvc/llvm-project?view=revision&revision=253337

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151201/a8decf52/attachment.html>


More information about the llvm-bugs mailing list