<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 7, 2009, at 2:48 AM, Roman Levenstein wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br><br> As you can see, PrologEpilogInserter has inserted at the beginning<br>of the function some code for manipulation of the frame pointer and<br>this inserted code uses the LR register.<br> As far as I understand, ARMRegisterInfo.td should exclude the LR<br>register from the set of allocatable registers for functions that<br>require frame pointer manipulation.<br> But currently it is not the case, or?</div></blockquote><div><br></div>No, LR is not the frame pointer. It's the link register (caller address). It should be available as a general purpose register. The bug is elsewhere. It has to do with kill / dead markers.</div><div><br></div><div><span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 11px; "> %LR<def> = LDR <fi#0>, %reg0, 0, 14, %reg0<br> %SP<def> = ADDri %SP<kill>, 4, 14, %reg0, %reg0<br> BX_RET 14, %reg0</span></div><div><font class="Apple-style-span" face="-webkit-monospace" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace" size="3"><span class="Apple-style-span" style="font-size: 11px;">LR is restored here but it's not killed before the end of the block is reached. Should BX_RET use it?</span></font></div><div><br></div><div>Evan</div><div><br></div><div><blockquote type="cite"><div><br><br> I hope that I provided enough information to explain my problem. I<br>also provided my initial analysis, but may be I'm wrong.<br><br> Can someone more knowledgeable in ARM backend and LLVM's register<br>allocation framework have a look at it?<br> If it is a bug in the ARM backend, could it be fixed?<br><br> Thanks,<br> Roman<br><span><bugpoint-reduced-simplified.bc></span></div></blockquote></div><br></body></html>