[llvm-bugs] [Bug 27241] New: X86 call frame optimization should be generalized to support 64-bit targets
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Apr 6 06:24:41 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27241
Bug ID: 27241
Summary: X86 call frame optimization should be generalized to
support 64-bit targets
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: unassignedbugs at nondot.org
Reporter: david.l.kreitzer at intel.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
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
-------------
--
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/20160406/c5272154/attachment.html>
More information about the llvm-bugs
mailing list