<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 5, 2011, at 10:57 AM, Peter Lawrence wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Guys,<div>           on second thought...</div><div><br></div><div>doesn't making the exception registers live from the InvokeInst to the LandingpadInst</div><div>create problems for critical-edge-splitting ?</div><div><br></div><div>if a landingpad-edge is critical and needs to be split, won't we be creating and inserting</div><div>a new BB between the "invoke-block" and the "landingpad-block", and if we do then</div><div>isn't there the possibility of the register allocator spilling the contents of the exception</div><div>registers from within the newly created block --- but this block won't ever get executed</div><div>because the _Unwind_ / _personality_ functions will cause control flow to go directly</div><div>to the block with the LandingpadInst ?   If you really want to split a landingpad-edge</div><div>won't you have to move the LandingpadInst up into the new block  ?</div></div></blockquote><div><br></div><div>You cannot split critical edges to landing pads, but you can duplicate landing pads and distribute the predecessors any way you like.</div><div><br></div><div>The requirement is that all unwind edges go to landing pads and all non-unwind edges go to non-landing pads. That will also be required in the code generator.</div><div><br></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>if this is true (and I seem to be making a lot of logic errors lately, so maybe reread and</div><div>proof-read the above a few times...!...) then don't we need to add another invariant to</div><div>Bill's list:</div><div><br></div><div>*) there can be no code between an InvokeInst and its LandingpadInst other than</div><div>possibly PHINodes at the beginning of the landingpad-block.</div></div></blockquote><div><br></div>I think this covers it:<br><div><ul><li>A landing pad block must have a '<tt>landingpad</tt>' instruction as its first non-PHI instruction.</li><li>There can be only one '<tt>landingpad</tt>' instruction within the landing pad block.</li><li>A basic block that is not a landing pad block may not include a '<tt>landingpad</tt>' instruction.</li></ul></div></div><div>/jakob</div><div><br></div></body></html>