<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 23, 2015 at 3:31 PM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>It would be really nice to just emit a label next to an instruction and assume the stackmap entry will end up at the right address. I don’t think the backend can make that guarantee. Any Machine pass can insert instructions wherever it wants without looking for labels.</div><div><br></div><div>I think labels are only employed just before code emission. Is there any existing example of labels being used earlier (I think GCRootLowering is the earliest)?</div></div></div></blockquote><div><br></div><div>SelectionDAGBuilder::lowerInvokable() inserts EH_LABELs into the DAG for normal invokes, and it more or less works out.</div><div><br></div><div>I don't know much about what transformations MI passes typically do, but my guess is that you're concerned that some pass might re-schedule possibly trapping operations inside the label range?</div></div></div></div>