[LLVMdev] Possible bug in the ARM backend?

Evan Cheng evan.cheng at apple.com
Wed Jan 7 08:25:24 PST 2009


On Jan 7, 2009, at 2:48 AM, Roman Levenstein wrote:

>
>
>  As you can see, PrologEpilogInserter has inserted at the beginning
> of the function some code for manipulation of the frame pointer and
> this inserted code uses the LR register.
>  As far as I understand,  ARMRegisterInfo.td should exclude the LR
> register from the set of allocatable registers for functions that
> require frame pointer manipulation.
>  But currently it is not the case, or?

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.

        %LR<def> = LDR <fi#0>, %reg0, 0, 14, %reg0
        %SP<def> = ADDri %SP<kill>, 4, 14, %reg0, %reg0
        BX_RET 14, %reg0

LR is restored here but it's not killed before the end of the block is  
reached. Should BX_RET use it?

Evan

>
>
>  I hope that I provided enough information to explain my problem. I
> also provided my initial analysis, but may be I'm wrong.
>
>  Can someone more knowledgeable in ARM backend and LLVM's register
> allocation framework have a look at it?
>  If it is a bug in the ARM backend, could it be fixed?
>
>  Thanks,
>   Roman
> <bugpoint-reduced-simplified.bc>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090107/486a2f0e/attachment.html>


More information about the llvm-dev mailing list