1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
llvm-mirror/test/CodeGen/X86/inalloca-stdcall.ll
Reid Kleckner 239e9806ff Implement inalloca codegen for x86 with the new inalloca design
Calls with inalloca are lowered by skipping all stores for arguments
passed in memory and the initial stack adjustment to allocate argument
memory.

Now the frontend is responsible for the memory layout, and the backend
doesn't have to do any work.  As a result these changes are pretty
minimal.

Reviewers: echristo

Differential Revision: http://llvm-reviews.chandlerc.com/D2637

llvm-svn: 200596
2014-01-31 23:50:57 +00:00

27 lines
695 B
LLVM

; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s
%Foo = type { i32, i32 }
declare x86_stdcallcc void @f(%Foo* inalloca %a)
declare x86_stdcallcc void @i(i32 %a)
define void @g() {
%b = alloca %Foo, inalloca
; CHECK: movl $8, %eax
; CHECK: calll __chkstk
; CHECK: movl %[[REG:[^,]*]], %esp
%f1 = getelementptr %Foo* %b, i32 0, i32 0
%f2 = getelementptr %Foo* %b, i32 0, i32 1
store i32 13, i32* %f1
store i32 42, i32* %f2
; CHECK: movl $13, (%[[REG]])
; CHECK: movl $42, 4(%[[REG]])
call x86_stdcallcc void @f(%Foo* inalloca %b)
; CHECK: calll _f@8
; CHECK-NOT: %esp
; CHECK: subl $4, %esp
; CHECK: calll _i@4
call x86_stdcallcc void @i(i32 0)
ret void
}