patch: emit tail calls with zeroext/signext on return

Richard Smith richard at metafoo.co.uk
Tue Jul 30 00:57:30 PDT 2013


On Mon, Jul 29, 2013 at 11:43 PM, Nick Lewycky <nlewycky at google.com> wrote:

> Currently clang can't emit a tail call on:
>
>   bool g(); bool f() { return g(); }
>
> 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.
>
> Please review!
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130730/0afd3ccf/attachment.html>


More information about the llvm-commits mailing list