<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 12, 2017 at 8:14 AM, Juan Manuel Martinez Caamaño via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, Folks!<div>There are restrictions on the IR that is allowed inside a funclet which are not enforced by the verifier. </div><div>Among them:<br></div><div><ul><li>[1]<i> No variables live into or out of the funclet can be allocated in registers.</i></li></ul></div></div></blockquote><div>This is achieved transparently in the backend with a full register clobber in funclet prologue and epilogue BBs.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><ul><li>[2]<i> If any funclet EH pads have been “entered” but not “exited” it is undefined behavior to execute a call or invoke which:</i></li><ul><li><i>does not have a "funclet" bundle and is not a call to a nounwind intrinsic, or</i></li><li><i>has a "funclet" bundle whose operand is not the most-recently-entered not-yet-exited funclet EH pad.</i></li></ul></ul></div></div></blockquote><div>It's UB, so we don't need to enforce it in the verifier. We transform these calls to unreachable in WinEHPrepare.</div><div><br></div><div>I don't think we can enforce it. I can't remember the example off the top of my head, but valid IR transformations can introduce edges from funclets to calls with the wrong funclet bundle. By not enforcing this rule in the Verifier, we allow those transformations to remain blissfully unaware of funclet insanity.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Is there any reason for the Verifier not to enforce these constraints? I started to add these checks to the Verifier.</div><div><br></div><div>Cheers,</div><div>Juan</div><div><i><br></i></div><div>[1] <a href="http://llvm.org/docs/ExceptionHandling.html#id32" target="_blank">http://llvm.org/docs/<wbr>ExceptionHandling.html#id32</a></div><div>[2] <a href="http://llvm.org/docs/LangRef.html#funclet-operand-bundles" target="_blank">http://llvm.org/docs/<wbr>LangRef.html#funclet-operand-<wbr>bundles</a></div></div></div><span class="HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><p dir="ltr">Juan Manuel Martinez Caamaño</p>
</div></div>
</font></span><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>