<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 23, 2011, at 12:26 AM, Jakob Stoklund Olesen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Optima; 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>SjLj is weird. How do we pass values along unwind edges today? Don't they need to dominate the setjmp call?</div></span></blockquote></div><br><div>We pass them through memory:</div><div><br></div><div><div>      // If we decided we need a spill, do it.</div><div>      // FIXME: Spilling this way is overkill, as it forces all uses of</div><div>      // the value to be reloaded from the stack slot, even those that aren't</div><div>      // in the unwind blocks. We should be more selective.</div><div>      if (NeedsSpill) {</div><div>        ++NumSpilled;</div><div>        DemoteRegToStack(*Inst, true);</div><div>      }</div><div> </div></div><div>So after SjLjEHPrepare, the invokes should probably be turned into calls and the unwind edges removed.</div><div><br></div><div>The unwind edges don't represent control flow anymore, and they are not needed for dominance. They are only used for:</div><div><br></div><div><div>  // We still want this to look like an invoke so we emit the LSDA properly,</div><div>  // so we don't transform the invoke into a call here.</div><div><br></div></div><div>It is possible we could feed all of them to a dummy landing pad that then branches to setjmp's second return?</div><div><br></div><div>/jakob</div><div><br></div></body></html>