<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - DSE fails to remove/fold stores"
href="https://bugs.llvm.org/show_bug.cgi?id=50074">50074</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>DSE fails to remove/fold stores
</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>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>david.bolvansky@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>void dse_fold(unsigned char* p, unsigned char* q, int i){
p[i]=0;
q[i]=0;
// ...
p[i]++;
}
void dse_fold2(unsigned char* p, unsigned char* q, int i){
p[i]=0;
q[i]=0;
// ...
p[i] = 1;
}
void dse_fold3(unsigned char* p, unsigned char* q, int i){
p[i]=0;
q[i]=0;
// ...
p[i] += 100;
}
LLVM -O3:
dse_fold(unsigned char*, unsigned char*, int): #
@dse_fold(unsigned char*, unsigned char*, int)
movsxd rax, edx
mov byte ptr [rdi + rax], 0
mov byte ptr [rsi + rax], 0
add byte ptr [rdi + rax], 1
ret
dse_fold2(unsigned char*, unsigned char*, int): #
@dse_fold2(unsigned char*, unsigned char*, int)
movsxd rax, edx
mov byte ptr [rsi + rax], 0
mov byte ptr [rdi + rax], 1
ret
dse_fold3(unsigned char*, unsigned char*, int): #
@dse_fold3(unsigned char*, unsigned char*, int)
movsxd rax, edx
mov byte ptr [rdi + rax], 0
mov byte ptr [rsi + rax], 0
add byte ptr [rdi + rax], 100
ret
GCC -O3:
dse_fold(unsigned char*, unsigned char*, int):
movsx rdx, edx
mov BYTE PTR [rsi+rdx], 0
mov BYTE PTR [rdi+rdx], 1
ret
dse_fold2(unsigned char*, unsigned char*, int):
movsx rdx, edx
mov BYTE PTR [rsi+rdx], 0
mov BYTE PTR [rdi+rdx], 1
ret
dse_fold3(unsigned char*, unsigned char*, int):
movsx rdx, edx
mov BYTE PTR [rsi+rdx], 0
mov BYTE PTR [rdi+rdx], 100
ret
<a href="https://godbolt.org/z/7bbrs6P5M">https://godbolt.org/z/7bbrs6P5M</a></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>