<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 --- - Induction Variable Simplification Pass promotes i32 operations to i64"
href="http://llvm.org/bugs/show_bug.cgi?id=21148">21148</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Induction Variable Simplification Pass promotes i32 operations to i64
</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>Linux
</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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tstellar@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>atrick@apple.com, 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=13130" name="attach_13130" title="Test Case">attachment 13130</a> <a href="attachment.cgi?id=13130&action=edit" title="Test Case">[details]</a></span>
Test Case
I've run into the issue where the Induction Variable Simplification Pass will
promote i32 operations to i64, which negatively impacts performance on AMDGPU
targets.
The problem occurs when the induction variable is used for address calculations
of pointers with different sizes. For example:
kernel void test(global int *out, int a) {
private int array[16];
...
for (int i = 0; i < 16; i++)
out[i * 3 + a] = array[i];
}
Here global pointers are 64-bit and private pointers are 32-bit. In this case
the indvars pass tries to promote the induction variable to 64 bits which
causes the address calculations for the out pointer to be 64-bit operations.
I've attached an LLVM IR test case the demonstrates the issue.</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>