On Mon, Jul 29, 2013 at 11:43 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Currently clang can't emit a tail call on:<div><br></div><div>  bool g(); bool f() { return g(); }</div><div><br></div><div>because we lower the functions to have "zeroext i1" return. This patch updates the safety check in codegen which currently forbids zeroext/signext from ever participating in tail calls to instead check that the caller and callee match.</div>


<div><br></div><div>Please review!</div></div></blockquote><div><br></div><div>Is this still more conservative than required? Since zeroext and signext mean "extended by callee" for a return value (and non-{zero,sign}ext appears to mean "high bits are junk"), it seems like we should also be able to emit a tail call when a non-{zero,sign}ext function calls a {zero,sign}ext function, as in your test_extend3 case.</div>
</div>