<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Chris,<div>           it is goodness that the LandingpadInst will be pinned to the beginning</div><div>of a BasicBlock,...  except for the possibility of PHINode instructions that _must_</div><div>come even earlier.?.</div><div><br></div><div>I can't exactly put my finger on what's going to go wrong with this, </div><div>but it sure smells fishy...</div><div><br></div><div><br></div><div>my current understanding is that the LandingpadInst will "define" some hard</div><div>registers which will be used by following code to switch to the corresponding</div><div>catch-clause</div><div><br></div><div>the lifetimes of these hard registers ostensibly starts at the LandingpadInst,</div><div>but for purposes of PHI lowering and Register Allocation they _must_ actually</div><div>start at the beginning of the BasicBlock -- since that is where control flow will</div><div>return to from the _Unwind_RaiseException / __gcc_personality_v0 calls,</div><div>and it is the _Unwind_ and _personality_ functions that physically set those</div><div>hard registers, not the "LandingpadInst".</div><div><br></div><div>Somehow PHI lowering and register allocation need to be prohibited from</div><div>using those hard registers for spill code at the beginning of a "landing pad block",</div><div>but I don't see how that will "fall out" of the current design.?.</div><div><br></div><div><br></div><div><br></div><div>-Peter Lawrence.</div><div><br></div><div><br></div><div><br></div><div><br><div><div>On Aug 3, 2011, at 12:35 AM, <a href="mailto:llvmdev-request@cs.uiuc.edu">llvmdev-request@cs.uiuc.edu</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">I agree with Bill in this case.<span class="Apple-converted-space">  </span>The reason for landingpad to be an instruction is a) make it clear that it is magic in several ways (e.g. pinned to the start of a block), and b) so that LandingPadInst can have a bunch of useful accessors on it.</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">-Chris</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px"><br></p> </blockquote></div><br></div></body></html>