<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - zeroext i1 returning functions don't get TCO"
   href="http://llvm.org/bugs/show_bug.cgi?id=16742">16742</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>zeroext i1 returning functions don't get TCO
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, nlewycky@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>