[LLVMbugs] [Bug 17229] New: x86 FMA could choose different instruction to avoid move

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 13 09:05:17 PDT 2013


            Bug ID: 17229
           Summary: x86 FMA could choose different instruction to avoid
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: kkhoo at perfwizard.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

AMD/Intel have provided FMA variants for all possible register combinations,
but LLVM isn't choosing the most efficient one here:

$ ./clang -v 
clang version 3.4 (trunk 189776)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

$ cat fma2.c 
double foo(double x, double y, double z) {
    return y*z + x;

$ ./clang -S -O3 -fomit-frame-pointer -march=core-avx2 -o /dev/stdout fma2.c 
    .section    __TEXT,__text,regular,pure_instructions
    .globl    _foo
    .align    4, 0x90
_foo:                                   ## @foo
## BB#0:                                ## %entry
    vfmadd213sd    %xmm0, %xmm2, %xmm1
    vmovaps    %xmm1, %xmm0

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/20130913/d91aebd7/attachment.html>

More information about the llvm-bugs mailing list