<html>
    <head>
      <base href="https://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 --- - X86 call frame optimization should be generalized to support 64-bit targets"
   href="https://llvm.org/bugs/show_bug.cgi?id=27241">27241</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X86 call frame optimization should be generalized to support 64-bit targets
          </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>All
          </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>david.l.kreitzer@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On 64-bit Linux, we should use pushes to store outgoing arguments to the stack
just like we do for 32-bits (subject to profitability checks). For example, in
the calls to f2 below, the last 3 arguments could be passed via push.

---- t.ll ----
target triple = "x86_64-unknown-linux-gnu"

define void @f1() {
entry:
  tail call void @f2(i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48,
i32 49, i32 50)
  ret void
}

declare void @f2(i32, i32, i32, i32, i32, i32, i32, i32, i32)
--------------

Like this:

---- t.s ----
f1:                                     # @f1
    .cfi_startproc
# BB#0:                                 # %entry
    pushq    %rax
.Ltmp0:
    .cfi_def_cfa_offset 16
    subq    $8, %rsp
.Ltmp1:
    .cfi_adjust_cfa_offset 8
    movl    $42, %edi
    movl    $43, %esi
    movl    $44, %edx
    movl    $45, %ecx
    movl    $46, %r8d
    movl    $47, %r9d
    pushq    $50
.Ltmp2:
    .cfi_adjust_cfa_offset 8
    pushq    $49
.Ltmp3:
    .cfi_adjust_cfa_offset 8
    pushq    $48
.Ltmp4:
    .cfi_adjust_cfa_offset 8
    callq    f2
    addq    $32, %rsp
.Ltmp5:
    .cfi_adjust_cfa_offset -32
    popq    %rax
    retq
-------------</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>