mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 23:31:37 +00:00
8a24e83550
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200596 91177308-0d34-0410-b5e6-96231b3b80d8
27 lines
695 B
LLVM
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
|
|
}
|