[LLVMdev] Broke my tail (call)
Jon Harrop
jon at ffconsultancy.com
Fri Mar 27 22:16:02 PDT 2009
On Tuesday 24 February 2009 14:54:12 Arnold Schwaighofer wrote:
> On Tue, Feb 24, 2009 at 11:50 AM, Jon Harrop <jon at ffconsultancy.com> wrote:
> > Thanks for the clarification. That makes a lot more sense!
> >
> > LLVM's support for structs is wonderful but I don't think they can be
> > called "first-class structs" until all such arbitrary restrictions have
> > been removed, even though the workaround (using sret form) is trivial in
> > this case.
> >
> > Shall I file this as a bug against LLVM?
>
> Yes please do and maybe include the following code which already
> exhibits the error in the bug report.
>
> define fastcc { { i8*, i8* }*, i8*} @init({ { i8*, i8* }*, i8*}, i32) {
> entry:
> %2 = tail call fastcc { { i8*, i8* }*, i8* } @init({ { i8*,
> i8*}*, i8*} %0, i32 %1)
> ret { { i8*, i8* }*, i8*} %2
> }
I just noticed that altering my representation of the unit type also seems to
break tail calls. Specifically, if I return the i1 or i8 types. Is that
expected to break tail calls as well as returning structs? If so, when
exactly can tail calls be relied upon?
Looks like i64 works fine on 32-bit, so it is not just non-word-sized values
that are breaking it.
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
More information about the llvm-dev
mailing list