Frames-dyn-alloca-with-func-call.ll
3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | \
; RUN: FileCheck %s -check-prefix=PPC32-LINUX
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu \
; RUN: -frame-pointer=all | FileCheck %s -check-prefix=PPC32-LINUX
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu | \
; RUN: FileCheck %s -check-prefixes=PPC64,PPC64-LINUX
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
; RUN: -frame-pointer=all | FileCheck %s -check-prefixes=PPC64,PPC64-LINUX
; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
; RUN: -mtriple=powerpc-ibm-aix-xcoff | FileCheck %s \
; RUN: -check-prefix=PPC32-AIX
; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
; RUN: -mtriple=powerpc-ibm-aix-xcoff -frame-pointer=all | FileCheck %s \
; RUN: -check-prefix=PPC32-AIX
; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
; RUN: -mtriple=powerpc64-ibm-aix-xcoff | FileCheck %s \
; RUN: -check-prefixes=PPC64,PPC64-AIX
; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
; RUN: -mtriple=powerpc64-ibm-aix-xcoff -frame-pointer=all | FileCheck %s \
; RUN: -check-prefixes=PPC64,PPC64-AIX
define dso_local signext i32 @foo(i32 %n) {
entry:
%ptr0 = alloca i32*
%0 = alloca i32, i32 %n
store i32* %0, i32** %ptr0
%1 = alloca i32, i32 %n
%2 = alloca i32, i32 %n
%3 = alloca i32, i32 %n
%4 = alloca i32, i32 %n
%5 = alloca i32, i32 %n
%6 = alloca i32, i32 %n
%7 = alloca i32, i32 %n
%8 = alloca i32, i32 %n
%9 = load i32*, i32** %ptr0
%call = call i32 @bar(i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9)
ret i32 %call
}
declare i32 @bar(i32*, i32*, i32*, i32*, i32*, i32*, i32*, i32*, i32*)
; PPC32-LINUX-LABEL: foo
; PPC32-LINUX: mflr 0
; PPC32-LINUX: stw 0, 4(1)
; PPC32-LINUX: stwu 1, -32(1)
; PPC32-LINUX: stw 31, 28(1)
; PPC32-LINUX: mr 31, 1
; PPC32-LINUX: addi 3, 31, 32
; PPC32-LINUX: stwux 3, 1, 10
; Allocated area is referred by stack pointer.
; PPC32-LINUX: addi 11, 1, 16
; Local variable area is referred by frame pointer.
; PPC32-LINUX: stw 11, 24(31)
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX: stwux
; PPC32-LINUX-NOT: stuwux
; Parameter save area is referred by stack pointer.
; PPC32-LINUX: stw 11, 8(1)
; PPC32-LINUX: bl bar
; PPC32-LINUX: lwz 31, 0(1)
; PPC32-LINUX: lwz 0, -4(31)
; PPC32-LINUX: mr 1, 31
; PPC32-LINUX: mr 31, 0
; PPC32-LINUX: lwz 0, 4(1)
; PPC32-LINUX: mtlr 0
; PPC32-LINUX: blr
; PPC64-LABEL: foo
; PPC64: mflr 0
; PPC64: std 31, -8(1)
; PPC64: std 0, 16(1)
; PPC64: stdu 1, -160(1)
; PPC64: mr 31, 1
; PPC64: addi 3, 31, 160
; PPC64: stdux 3, 1, 10
; Allocated area is referred by stack pointer.
; PPC64: addi 11, 1, 128
; Local variable area is referred by frame pointer.
; PPC64: std 11, 144(31)
; PPC64: stdux
; PPC64: stdux
; PPC64: stdux
; PPC64: stdux
; PPC64: stdux
; PPC64: stdux
; PPC64: stdux
; PPC64: stdux
; PPC64-NOT: stdux
; Parameter save area is referred by stack pointer.
; PPC64: std 11, 112(1)
; PPC64-LINUX: bl bar
; PPC64-AIX: bl .bar
; PPC64: ld 1, 0(1)
; PPC64: ld 0, 16(1)
; PPC64-DAG: ld 31, -8(1)
; PPC64-DAG: mtlr 0
; PPC64: blr
; PPC32-AIX: mflr 0
; PPC32-AIX: stw 31, -4(1)
; PPC32-AIX: stw 0, 8(1)
; PPC32-AIX: stwu 1, -80(1)
; PPC32-AIX: mr 31, 1
; PPC32-AIX: addi 3, 31, 80
; PPC32-AIX: stwux 3, 1, 10
; Allocated area is referred by stack pointer.
; PPC32-AIX: addi 11, 1, 64
; Local variable area is referred by frame pointer.
; PPC32-AIX: stw 11, 72(31)
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX: stwux
; PPC32-AIX-NOT: stwux
; Parameter save area is referred by stack pointer.
; PPC32-AIX: stw 11, 56(1)
; PPC32-AIX: bl .bar
; PPC32-AIX: nop
; PPC32-AIX: lwz 1, 0(1)
; PPC32-AIX: lwz 0, 8(1)
; PPC32-AIX-DAG: mtlr 0
; PPC32-AIX-DAG: lwz 31, -4(1)
; PPC32-AIX: blr