<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 --- - FastISel doesn't respect vector alignment requirements"
href="http://llvm.org/bugs/show_bug.cgi?id=16640">16640</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>FastISel doesn't respect vector alignment requirements
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>boulos@cs.stanford.edu
</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>Created <span class=""><a href="attachment.cgi?id=10885" name="attach_10885" title="Input source">attachment 10885</a> <a href="attachment.cgi?id=10885&action=edit" title="Input source">[details]</a></span>
Input source
I ran across some code in a project that seems to be a bug in FastISel
triggered by the new vectorizer in LLVM 3.3 (which doesn't seem to have a bug
version available yet in bugzilla). I have a loop like this:
int* x;
for (i = 0; i < len; i++) {
x[i] = i;
}
which the new vectorizer dutifully vectorizes. If I run with FastISel and x
doesn't end up 16-byte aligned, however, I get a segfault (seemingly
incorrectly, this is really just an unaligned access with SSE). The fault is
caused by LLVM generating movdqa instead of movdqu. The body of the vectorized
IR has stores like so:
store <4 x i32> %induction18.i, <4 x i32>* %5, align 4
so the vectorizer and other bits itself seem to be just fine, but FastISel is
probably choosing the wrong vector store instruction. I couldn't track down
where in the FastISel codepath this happens, but hopefully someone more
familiar with it will see it.
Original simplified source and bitcode attached. To repro:
clang -emit-llvm -c -O3 bad-vec.c -o bad-vec.bc
llvm-dis bad-vec.bc # for inspection
lli -O3 -fast-isel bad-vec.ll abcdefghi 4
The first argument generates the length of the array, while the second argument
is a dynamic offset (the optimization passes are too clever for me to embed
this in the source).</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>