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

            Bug ID: 16742
           Summary: zeroext i1 returning functions don't get TCO
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Running this through clang:

  bool g(); bool f() { return g(); }

Generates this:

define zeroext i1 @_Z1fv() #0 {
entry:
  %call = tail call zeroext i1 @_Z1gv()
  ret i1 %call
}

declare zeroext i1 @_Z1gv() #1

... which produces suboptimal assembly:

_Z1fv:                                  # @_Z1fv
        pushq   %rax
        callq   _Z1gv
        popq    %rdx
        ret

If I strip out the 'zeroext' and run through llc, I instead get this:

_Z1fv:                                  # @_Z1fv
        jmp     _Z1gv                   # TAILCALL

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to