[LLVMbugs] [Bug 16742] New: zeroext i1 returning functions don't get TCO

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 29 18:12:14 PDT 2013


            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: unassignedbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, nlewycky at google.com
    Classification: Unclassified

Running this through clang:

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

Generates this:

define zeroext i1 @_Z1fv() #0 {
  %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

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

More information about the llvm-bugs mailing list