[LLVMdev] RFC: Exception Handling Rewrite
    Jakob Stoklund Olesen 
    jolesen at apple.com
       
    Thu Aug  4 16:40:59 PDT 2011
    
    
  
On Aug 4, 2011, at 4:16 PM, Andrew Trick wrote:
> Hi Peter,
> 
> Thanks for pointing this out. Some us who are concerned with codegen have discussed the problem. Although the details aren't decided, you can be sure that at the MachineInstr level we won't have a landindpadInst to model liveness of exception values. Any physical registers set by the personality function will be considered live immediately after the call on the unwind path.
Right.
My intention here is to mark the CALL instruction as a terminator:
BB1:
  %R0 = COPY %vreg0; 1st arg
  %R1 = COPY %vreg1; 2nd arg
  CALL foo
Successors: BB2, BB3
BB2:
Live-in: %R0
  %vreg2 = COPY %R0; Return value
  BR BB7
BB3: LANDING PAD
Live-in: %R0, %R1
  %vreg10 = COPY %R0; Ex addr
  %vreg11 = COPY %R1; EH selector
BB2 must be a layout successor of BB1, but we can already handle that.
This code layout also clearly marks the call that may unwind: It is the terminator with an edge to a landing pad. That means we can get rid of the EH_LABELS we currently use to mark the call.
/jakob
    
    
More information about the llvm-dev
mailing list