[Dwarf-Discuss] FDEs involving predicated instructions

Humphreys, Jonathan j-humphreys@ti.com
Mon Apr 22 18:47:46 GMT 2013


Sure, I'll use ARM as it's a pretty well-known processor.

Suppose I have an epilog that consists of stack deallocation and a combined SOE register save and return.  And suppose that the predecessor block will conditionally fall through to the epilog.  So we have:

continue:
        ....
        BEQ continue
Epilog:
        ...
        ADD       SP, SP, #52
        POP       {V1, V2, V3, V4, V5, V6, V7, V8, PC}

Let's then say that the optimizer sees a stall in the predecessor block where it can place the stack deallocation instruction.  But to move it into the predecessor block, it must predicate the instruction so that it only executes on the fall through path.  We then have:

continue:
....
        ADDNE     SP, SP, #52
        BEQ continue
Epilog:
        ...
        POP       {V1, V2, V3, V4, V5, V6, V7, V8, PC}

In the unoptimized case, the compiler would put a DWARF directive after the ADD instruction to indicate the CFA has changed by 52.  I cannot do the same in the optimized case without also predicating the DWARF directive somehow.

So my question is how do we support DWARF directives on predicated instructions where the effect of the instruction may not happen, depending upon some predicate or status register.

I hope this helps.
Thanks
Jon

-----Original Message-----
From: Michael Eager [mailto:eager@eagercon.com] 
Sent: Friday, April 19, 2013 6:05 PM
To: Humphreys, Jonathan
Cc: dwarf-discuss at lists.dwarfstd.org
Subject: Re: [Dwarf-Discuss] FDEs involving predicated instructions

On 04/19/2013 03:50 PM, Humphreys, Jonathan wrote:
> I?m wondering the best way to handle predicated prolog/epilog 
> instructions in the Call Frame Information.
>
> Suppose you have an epilog instruction that restores an SOE register 
> and it is predicated and scheduled in a predecessor block.  How do you 
> handle emitting an FDE rule that describes that a register is restored when a predicate or status register is a certain value?
>
> I can give an example if this isn?t clear.

Yes, an example would be helpful.


-- 
Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077




More information about the Dwarf-discuss mailing list