<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Aug 5, 2011, at 11:06 AM, Andrew Trick wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Aug 5, 2011, at 10:57 AM, Peter Lawrence wrote:</div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>However it seems that if a landingpad-block has multiple predecessors (often the case,</div><div>multiple InvokeInst in the main body of a try-statement all go to the same landingpad-</div><div>block), then you cannot move the LandingpadInst in order to break a critical edge unless</div><div>you do it for _all_  landingpad-block predecessor edges simultaneously, but that seems</div><div>to be a messy conclusion (being forced to split other edges that don't need to be split).</div></span></blockquote></div></div></blockquote><div><br></div>Yes, this is why we're not going to have SplitCriticalEdge</div><div>succeed on landing pad edges, at least by default.  It's not conceptually</div><div>impossible, but it is significantly more invasive than a normal</div><div>edge-splitting, and pretty much every client would need to be</div><div>updated to handle it.</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I think this will be done lazily to avoid excessive splitting as in:</div><div><br></div><div>Call1 -> LP</div><div>Call2 -> LP</div><div>Call3 -> LP</div><div><br></div><div>=> split Call1</div><div><br></div><div>Call1 -> LP-split -> LP-remainder</div><div>Call2 -> LP-split-merge -> LP-remainder</div><div>Call3 -> LP-split-merge -> LP-remainder</div></div></blockquote><div><br></div>Yes, this is precisely the transformation required for splitting a critical</div><div>edge to a landing pad.</div><div><br></div><div>If LP has n predecessors and k phis, such that looks like this:</div><div><br></div><div>  LP:</div><div>    %phi_i = phi [ %value_{i,1}, %call_1 ] .. [ %value_{i,n}, %call_n ]</div><div>    %lpad = landingpad LP-args</div><div>    LP-instructions...</div><div><br></div><div>then the three new blocks look like this:</div><div><br></div><div>  LP-split:</div><div>    %lpad-split = landingpad LP-args</div><div>    br label %LP-remainder</div><div><br></div><div>  LP-split-merge:</div><div>    %phi-split-merge_i = phi [ %value_{i,2}, %call_2 ] .. [ %value_{i,n}, %call_n ]</div><div>    %lpad-split-merge = landingpad LP-args</div><div>    br label %LP-remainder</div><div><br></div><div>  LP-remainder:</div><div>    %phi_i = phi [ %value_{i,1}, %LP-split ], [ %phi-split-merge, %LP-split-merge ]</div><div>    %lpad = phi [ %lpad-split, %LP-split ], [ %lpad-split-merge, %LP-split-merge ]</div><div>    LP-instructions...</div><div><br></div><div>In practice, we would want to recognize that LP has the form of an</div><div>LP-split-merge, with associated LP-remainder, and we would just re-use</div><div>that as our new LP-split-merge block, adding incoming values to the phis</div><div>in the LP-remainder as appropriate.</div><div><br></div><div>John.</div></body></html>