<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - missed opportunity to use vector FMA instruction"
href="http://llvm.org/bugs/show_bug.cgi?id=17236">17236</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>missed opportunity to use vector FMA instruction
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Loop Optimizer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kkhoo@perfwizard.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>I think this problem is similar to <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - missed opportunity to use absolute value vector instruction (vpabsd)"
href="show_bug.cgi?id=17172">bug 17172</a>. For a short vector, the SLP
vectorizer is not recognizing an FMA operation as a vector candidate?
$ ./clang -v
clang version 3.4 (trunk 189776)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
$ cat fma.c
#pragma STDC FP_CONTRACT ON
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
vmovsd (%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, (%rdi)
vmovsd 8(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 8(%rdi)
vmovsd 16(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 16(%rdi)
vmovsd 24(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 24(%rdi)
vmovsd 32(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 32(%rdi)
vmovsd 40(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 40(%rdi)
vmovsd 48(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 48(%rdi)
vmovsd 56(%rdi), %xmm0
vfmadd213sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 56(%rdi)
ret</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>