[LLVMbugs] [Bug 1392] NEW: Need support for true tail calls

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat May 5 15:02:54 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1392

           Summary: Need support for true tail calls
           Product: libraries
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


Some testcases:

------
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {jmp \\*ecx}
declare int %putchar(int)

int %main(){ 
 %f   = cast int (int, int*, int)* %check_tail to int*
 %res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
 ret int %res
}

fastcc int %check_tail(int %x, int* %f, int %g) {
        %tmp1 = setgt int %x, 0
        br bool %tmp1, label %if-then, label %if-else

if-then:
        %fun_ptr = cast int* %f to int(int, int*, int)* 
        %arg1    = add int %x, -1
        call int %putchar(int 90)       
        %res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
        ret int %res

if-else:
        ret int %x
}
------


------
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | not grep call
fastcc int %bar(int %X, int(double, int) *%FP) {
     %Y = tail call fastcc int %FP(double 0.0, int %X)
     ret int %Y
}
------



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list