[LLVMbugs] [Bug 17260] New: inefficient load instructions for vector operations (SLP vectorizer?)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 16 14:52:39 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17260

            Bug ID: 17260
           Summary: inefficient load instructions for vector operations
                    (SLP vectorizer?)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: kkhoo at perfwizard.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This is a very similar code sample to bug 17236, but with clang/llvm's current
default settings (no FMA by default, so no fmuladd ops in the IR), we expose a
different codegen problem:

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

$ cat fma.c
void foo(double *x) {
   int i;
   for(i=0; i<8; i++) {    
      x[i] = x[i] * x[i] + x[i];
   }
}

$ ./clang -S -O3 -fomit-frame-pointer -march=core-avx2 -o /dev/stdout fma.c
    .section    __TEXT,__text,regular,pure_instructions
    .globl    _foo
    .align    4, 0x90
_foo:                                   ## @foo
    .cfi_startproc
## BB#0:                                ## %entry
    vmovupd    (%rdi), %xmm0
    vmulpd    %xmm0, %xmm0, %xmm1
    vaddpd    %xmm1, %xmm0, %xmm0
    vmovupd    %xmm0, (%rdi)
    vmovsd    16(%rdi), %xmm0
    vmovhpd    24(%rdi), %xmm0, %xmm0
    vmulpd    %xmm0, %xmm0, %xmm1
    vaddpd    %xmm1, %xmm0, %xmm0
    vmovupd    %xmm0, 16(%rdi)
    vmovsd    32(%rdi), %xmm0
    vmovhpd    40(%rdi), %xmm0, %xmm0
    vmulpd    %xmm0, %xmm0, %xmm1
    vaddpd    %xmm1, %xmm0, %xmm0
    vmovupd    %xmm0, 32(%rdi)
    vmovsd    48(%rdi), %xmm0
    vmovhpd    56(%rdi), %xmm0, %xmm0
    vmulpd    %xmm0, %xmm0, %xmm1
    vaddpd    %xmm1, %xmm0, %xmm0
    vmovupd    %xmm0, 48(%rdi)
    ret

-- 
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/20130916/7bcde76f/attachment.html>


More information about the llvm-bugs mailing list