<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 --- - [SLP vectorizer] fast-math flags are not preserved"
href="http://llvm.org/bugs/show_bug.cgi?id=20802">20802</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[SLP vectorizer] fast-math flags are not preserved
</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>spatel+llvm@rotateright.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>There are several FP hints under:
<a href="http://llvm.org/docs/LangRef.html#fast-math-flags">http://llvm.org/docs/LangRef.html#fast-math-flags</a>
Using opt built from r216678:
$ cat slp.ll
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define void @slp(float* %x) {
%arrayidx2 = getelementptr inbounds float* %x, i64 1
%arrayidx3 = getelementptr inbounds float* %x, i64 2
%arrayidx4 = getelementptr inbounds float* %x, i64 3
%load1 = load float* %x, align 4
%load2 = load float* %arrayidx2, align 4
%load3 = load float* %arrayidx3, align 4
%load4 = load float* %arrayidx4, align 4
%sub1 = fsub fast float 0.0, %load1 ; FAST
%sub2 = fsub fast float 0.0, %load2 ; FAST
%sub3 = fsub fast float 0.0, %load3 ; FAST
%sub4 = fsub fast float 0.0, %load4 ; FAST
store float %sub1, float* %x, align 4
store float %sub2, float* %arrayidx2, align 4
store float %sub3, float* %arrayidx3, align 4
store float %sub4, float* %arrayidx4, align 4
ret void
}
$ ./opt -basicaa -slp-vectorizer slp.ll -S
; ModuleID = 'slp.ll'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define void @slp(float* %x) {
%arrayidx2 = getelementptr inbounds float* %x, i64 1
%arrayidx3 = getelementptr inbounds float* %x, i64 2
%arrayidx4 = getelementptr inbounds float* %x, i64 3
%1 = bitcast float* %x to <4 x float>*
%2 = load <4 x float>* %1, align 4
%3 = fsub <4 x float> zeroinitializer, %2 ; not so FAST
%4 = bitcast float* %x to <4 x float>*
store <4 x float> %3, <4 x float>* %4, align 4
ret void
}</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>