<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 --- - Thumb1: Folding SP Update incorrectly stop at modified pop"
href="http://llvm.org/bugs/show_bug.cgi?id=18399">18399</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Thumb1: Folding SP Update incorrectly stop at modified pop
</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>Backend: ARM
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhaoshiz@codeaurora.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, t.p.northover@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>In Thumb1, we check on whether registers are callee-saved when deciding to
pass by a pop instruction or not. But folding SP update adds caller-saved
registers to the pop, rendering the above mechanism invalid.
If tryFoldSPUpdateIntoPushPop() returns true, we can remember the modified pop
instruction. Later when moving past by callee-saved register restoration, we
can simply skip the remembered pop.
Tim, do you want me fix it or you have other plan?
$ cat test_case.ll
declare void @bar(i8*)
define void @test_varsize(...) minsize {
%var = alloca i8, i32 8
call void @bar(i8* %var)
ret void
}
$ llc -mtriple=thumbv5-unkown-unkown -disable-fp-elim test_case.ll -o -
.syntax unified
.eabi_attribute 6, 3
.eabi_attribute 8, 1
.eabi_attribute 9, 1
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.file "test_case.ll"
.text
.globl test_varsize
.align 1
.type test_varsize,%function
.code 16 @ @test_varsize
.thumb_func
test_varsize:
@ BB#0:
sub sp, #16
push {r5, r6, r7, lr}
add r7, sp, #8
str r3, [sp, #28]
str r2, [sp, #24]
str r1, [sp, #20]
str r0, [sp, #16]
mov r0, sp
bl bar
pop {r3}
add sp, #16
bx r3
bx lr
.Ltmp0:
.size test_varsize, .Ltmp0-test_varsize</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>