comparison test/CodeGen/AArch64/arm64-abi_align.ll @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 60c9769439b8
children 1172e4bd9c6f
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
57 define i32 @caller38() #1 { 57 define i32 @caller38() #1 {
58 entry: 58 entry:
59 ; CHECK-LABEL: caller38 59 ; CHECK-LABEL: caller38
60 ; CHECK: ldr x1, 60 ; CHECK: ldr x1,
61 ; CHECK: ldr x2, 61 ; CHECK: ldr x2,
62 %0 = load i64* bitcast (%struct.s38* @g38 to i64*), align 4 62 %0 = load i64, i64* bitcast (%struct.s38* @g38 to i64*), align 4
63 %1 = load i64* bitcast (%struct.s38* @g38_2 to i64*), align 4 63 %1 = load i64, i64* bitcast (%struct.s38* @g38_2 to i64*), align 4
64 %call = tail call i32 @f38(i32 3, i64 %0, i64 %1) #5 64 %call = tail call i32 @f38(i32 3, i64 %0, i64 %1) #5
65 ret i32 %call 65 ret i32 %call
66 } 66 }
67 67
68 declare i32 @f38_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, 68 declare i32 @f38_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
74 entry: 74 entry:
75 ; CHECK-LABEL: caller38_stack 75 ; CHECK-LABEL: caller38_stack
76 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8] 76 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8]
77 ; CHECK: movz w[[C:[0-9]+]], #0x9 77 ; CHECK: movz w[[C:[0-9]+]], #0x9
78 ; CHECK: str w[[C]], [sp] 78 ; CHECK: str w[[C]], [sp]
79 %0 = load i64* bitcast (%struct.s38* @g38 to i64*), align 4 79 %0 = load i64, i64* bitcast (%struct.s38* @g38 to i64*), align 4
80 %1 = load i64* bitcast (%struct.s38* @g38_2 to i64*), align 4 80 %1 = load i64, i64* bitcast (%struct.s38* @g38_2 to i64*), align 4
81 %call = tail call i32 @f38_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, 81 %call = tail call i32 @f38_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
82 i32 7, i32 8, i32 9, i64 %0, i64 %1) #5 82 i32 7, i32 8, i32 9, i64 %0, i64 %1) #5
83 ret i32 %call 83 ret i32 %call
84 } 84 }
85 85
110 define i32 @caller39() #1 { 110 define i32 @caller39() #1 {
111 entry: 111 entry:
112 ; CHECK-LABEL: caller39 112 ; CHECK-LABEL: caller39
113 ; CHECK: ldp x1, x2, 113 ; CHECK: ldp x1, x2,
114 ; CHECK: ldp x3, x4, 114 ; CHECK: ldp x3, x4,
115 %0 = load i128* bitcast (%struct.s39* @g39 to i128*), align 16 115 %0 = load i128, i128* bitcast (%struct.s39* @g39 to i128*), align 16
116 %1 = load i128* bitcast (%struct.s39* @g39_2 to i128*), align 16 116 %1 = load i128, i128* bitcast (%struct.s39* @g39_2 to i128*), align 16
117 %call = tail call i32 @f39(i32 3, i128 %0, i128 %1) #5 117 %call = tail call i32 @f39(i32 3, i128 %0, i128 %1) #5
118 ret i32 %call 118 ret i32 %call
119 } 119 }
120 120
121 declare i32 @f39_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, 121 declare i32 @f39_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
128 ; CHECK-LABEL: caller39_stack 128 ; CHECK-LABEL: caller39_stack
129 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32] 129 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32]
130 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16] 130 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16]
131 ; CHECK: movz w[[C:[0-9]+]], #0x9 131 ; CHECK: movz w[[C:[0-9]+]], #0x9
132 ; CHECK: str w[[C]], [sp] 132 ; CHECK: str w[[C]], [sp]
133 %0 = load i128* bitcast (%struct.s39* @g39 to i128*), align 16 133 %0 = load i128, i128* bitcast (%struct.s39* @g39 to i128*), align 16
134 %1 = load i128* bitcast (%struct.s39* @g39_2 to i128*), align 16 134 %1 = load i128, i128* bitcast (%struct.s39* @g39_2 to i128*), align 16
135 %call = tail call i32 @f39_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, 135 %call = tail call i32 @f39_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
136 i32 7, i32 8, i32 9, i128 %0, i128 %1) #5 136 i32 7, i32 8, i32 9, i128 %0, i128 %1) #5
137 ret i32 %call 137 ret i32 %call
138 } 138 }
139 139
166 define i32 @caller40() #1 { 166 define i32 @caller40() #1 {
167 entry: 167 entry:
168 ; CHECK-LABEL: caller40 168 ; CHECK-LABEL: caller40
169 ; CHECK: ldp x1, x2, 169 ; CHECK: ldp x1, x2,
170 ; CHECK: ldp x3, x4, 170 ; CHECK: ldp x3, x4,
171 %0 = load [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4 171 %0 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4
172 %1 = load [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4 172 %1 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4
173 %call = tail call i32 @f40(i32 3, [2 x i64] %0, [2 x i64] %1) #5 173 %call = tail call i32 @f40(i32 3, [2 x i64] %0, [2 x i64] %1) #5
174 ret i32 %call 174 ret i32 %call
175 } 175 }
176 176
177 declare i32 @f40_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, 177 declare i32 @f40_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
184 ; CHECK-LABEL: caller40_stack 184 ; CHECK-LABEL: caller40_stack
185 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #24] 185 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #24]
186 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8] 186 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8]
187 ; CHECK: movz w[[C:[0-9]+]], #0x9 187 ; CHECK: movz w[[C:[0-9]+]], #0x9
188 ; CHECK: str w[[C]], [sp] 188 ; CHECK: str w[[C]], [sp]
189 %0 = load [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4 189 %0 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4
190 %1 = load [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4 190 %1 = load [2 x i64], [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4
191 %call = tail call i32 @f40_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, 191 %call = tail call i32 @f40_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
192 i32 7, i32 8, i32 9, [2 x i64] %0, [2 x i64] %1) #5 192 i32 7, i32 8, i32 9, [2 x i64] %0, [2 x i64] %1) #5
193 ret i32 %call 193 ret i32 %call
194 } 194 }
195 195
220 define i32 @caller41() #1 { 220 define i32 @caller41() #1 {
221 entry: 221 entry:
222 ; CHECK-LABEL: caller41 222 ; CHECK-LABEL: caller41
223 ; CHECK: ldp x1, x2, 223 ; CHECK: ldp x1, x2,
224 ; CHECK: ldp x3, x4, 224 ; CHECK: ldp x3, x4,
225 %0 = load i128* bitcast (%struct.s41* @g41 to i128*), align 16 225 %0 = load i128, i128* bitcast (%struct.s41* @g41 to i128*), align 16
226 %1 = load i128* bitcast (%struct.s41* @g41_2 to i128*), align 16 226 %1 = load i128, i128* bitcast (%struct.s41* @g41_2 to i128*), align 16
227 %call = tail call i32 @f41(i32 3, i128 %0, i128 %1) #5 227 %call = tail call i32 @f41(i32 3, i128 %0, i128 %1) #5
228 ret i32 %call 228 ret i32 %call
229 } 229 }
230 230
231 declare i32 @f41_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, 231 declare i32 @f41_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
238 ; CHECK-LABEL: caller41_stack 238 ; CHECK-LABEL: caller41_stack
239 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32] 239 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32]
240 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16] 240 ; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16]
241 ; CHECK: movz w[[C:[0-9]+]], #0x9 241 ; CHECK: movz w[[C:[0-9]+]], #0x9
242 ; CHECK: str w[[C]], [sp] 242 ; CHECK: str w[[C]], [sp]
243 %0 = load i128* bitcast (%struct.s41* @g41 to i128*), align 16 243 %0 = load i128, i128* bitcast (%struct.s41* @g41 to i128*), align 16
244 %1 = load i128* bitcast (%struct.s41* @g41_2 to i128*), align 16 244 %1 = load i128, i128* bitcast (%struct.s41* @g41_2 to i128*), align 16
245 %call = tail call i32 @f41_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, 245 %call = tail call i32 @f41_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6,
246 i32 7, i32 8, i32 9, i128 %0, i128 %1) #5 246 i32 7, i32 8, i32 9, i128 %0, i128 %1) #5
247 ret i32 %call 247 ret i32 %call
248 } 248 }
249 249
258 ; FAST: f42 258 ; FAST: f42
259 ; FAST: ldr w[[A:[0-9]+]], [x1] 259 ; FAST: ldr w[[A:[0-9]+]], [x1]
260 ; FAST: ldr w[[B:[0-9]+]], [x2] 260 ; FAST: ldr w[[B:[0-9]+]], [x2]
261 ; FAST: add w[[C:[0-9]+]], w[[A]], w0 261 ; FAST: add w[[C:[0-9]+]], w[[A]], w0
262 ; FAST: add {{w[0-9]+}}, w[[C]], w[[B]] 262 ; FAST: add {{w[0-9]+}}, w[[C]], w[[B]]
263 %i1 = getelementptr inbounds %struct.s42* %s1, i64 0, i32 0 263 %i1 = getelementptr inbounds %struct.s42, %struct.s42* %s1, i64 0, i32 0
264 %0 = load i32* %i1, align 4, !tbaa !0 264 %0 = load i32, i32* %i1, align 4, !tbaa !0
265 %i2 = getelementptr inbounds %struct.s42* %s2, i64 0, i32 0 265 %i2 = getelementptr inbounds %struct.s42, %struct.s42* %s2, i64 0, i32 0
266 %1 = load i32* %i2, align 4, !tbaa !0 266 %1 = load i32, i32* %i2, align 4, !tbaa !0
267 %s = getelementptr inbounds %struct.s42* %s1, i64 0, i32 1 267 %s = getelementptr inbounds %struct.s42, %struct.s42* %s1, i64 0, i32 1
268 %2 = load i16* %s, align 2, !tbaa !3 268 %2 = load i16, i16* %s, align 2, !tbaa !3
269 %conv = sext i16 %2 to i32 269 %conv = sext i16 %2 to i32
270 %s5 = getelementptr inbounds %struct.s42* %s2, i64 0, i32 1 270 %s5 = getelementptr inbounds %struct.s42, %struct.s42* %s2, i64 0, i32 1
271 %3 = load i16* %s5, align 2, !tbaa !3 271 %3 = load i16, i16* %s5, align 2, !tbaa !3
272 %conv6 = sext i16 %3 to i32 272 %conv6 = sext i16 %3 to i32
273 %add = add i32 %0, %i 273 %add = add i32 %0, %i
274 %add3 = add i32 %add, %1 274 %add3 = add i32 %add, %1
275 %add4 = add i32 %add3, %conv 275 %add4 = add i32 %add3, %conv
276 %add7 = add i32 %add4, %conv6 276 %add7 = add i32 %add4, %conv6
367 ; FAST-LABEL: f43 367 ; FAST-LABEL: f43
368 ; FAST: ldr w[[A:[0-9]+]], [x1] 368 ; FAST: ldr w[[A:[0-9]+]], [x1]
369 ; FAST: ldr w[[B:[0-9]+]], [x2] 369 ; FAST: ldr w[[B:[0-9]+]], [x2]
370 ; FAST: add w[[C:[0-9]+]], w[[A]], w0 370 ; FAST: add w[[C:[0-9]+]], w[[A]], w0
371 ; FAST: add {{w[0-9]+}}, w[[C]], w[[B]] 371 ; FAST: add {{w[0-9]+}}, w[[C]], w[[B]]
372 %i1 = getelementptr inbounds %struct.s43* %s1, i64 0, i32 0 372 %i1 = getelementptr inbounds %struct.s43, %struct.s43* %s1, i64 0, i32 0
373 %0 = load i32* %i1, align 4, !tbaa !0 373 %0 = load i32, i32* %i1, align 4, !tbaa !0
374 %i2 = getelementptr inbounds %struct.s43* %s2, i64 0, i32 0 374 %i2 = getelementptr inbounds %struct.s43, %struct.s43* %s2, i64 0, i32 0
375 %1 = load i32* %i2, align 4, !tbaa !0 375 %1 = load i32, i32* %i2, align 4, !tbaa !0
376 %s = getelementptr inbounds %struct.s43* %s1, i64 0, i32 1 376 %s = getelementptr inbounds %struct.s43, %struct.s43* %s1, i64 0, i32 1
377 %2 = load i16* %s, align 2, !tbaa !3 377 %2 = load i16, i16* %s, align 2, !tbaa !3
378 %conv = sext i16 %2 to i32 378 %conv = sext i16 %2 to i32
379 %s5 = getelementptr inbounds %struct.s43* %s2, i64 0, i32 1 379 %s5 = getelementptr inbounds %struct.s43, %struct.s43* %s2, i64 0, i32 1
380 %3 = load i16* %s5, align 2, !tbaa !3 380 %3 = load i16, i16* %s5, align 2, !tbaa !3
381 %conv6 = sext i16 %3 to i32 381 %conv6 = sext i16 %3 to i32
382 %add = add i32 %0, %i 382 %add = add i32 %0, %i
383 %add3 = add i32 %add, %1 383 %add3 = add i32 %add, %1
384 %add4 = add i32 %add3, %conv 384 %add4 = add i32 %add3, %conv
385 %add7 = add i32 %add4, %conv6 385 %add7 = add i32 %add4, %conv6
491 ; FAST: mov x[[ADDR:[0-9]+]], sp 491 ; FAST: mov x[[ADDR:[0-9]+]], sp
492 ; FAST: str {{w[0-9]+}}, [x[[ADDR]], #16] 492 ; FAST: str {{w[0-9]+}}, [x[[ADDR]], #16]
493 ; Load/Store opt is disabled with -O0, so the i128 is split. 493 ; Load/Store opt is disabled with -O0, so the i128 is split.
494 ; FAST: str {{x[0-9]+}}, [x[[ADDR]], #8] 494 ; FAST: str {{x[0-9]+}}, [x[[ADDR]], #8]
495 ; FAST: str {{x[0-9]+}}, [x[[ADDR]]] 495 ; FAST: str {{x[0-9]+}}, [x[[ADDR]]]
496 %0 = load i128* bitcast (%struct.s41* @g41 to i128*), align 16 496 %0 = load i128, i128* bitcast (%struct.s41* @g41 to i128*), align 16
497 %call = tail call i32 @callee_i128_split(i32 1, i32 2, i32 3, i32 4, i32 5, 497 %call = tail call i32 @callee_i128_split(i32 1, i32 2, i32 3, i32 4, i32 5,
498 i32 6, i32 7, i128 %0, i32 8) #5 498 i32 6, i32 7, i128 %0, i32 8) #5
499 ret i32 %call 499 ret i32 %call
500 } 500 }
501 501
506 entry: 506 entry:
507 ; CHECK-LABEL: i64_split 507 ; CHECK-LABEL: i64_split
508 ; "i64 %0" should be in register x7. 508 ; "i64 %0" should be in register x7.
509 ; "i32 8" should be on stack at [sp]. 509 ; "i32 8" should be on stack at [sp].
510 ; CHECK: ldr x7, [{{x[0-9]+}}] 510 ; CHECK: ldr x7, [{{x[0-9]+}}]
511 ; CHECK: str {{w[0-9]+}}, [sp] 511 ; CHECK: str {{w[0-9]+}}, [sp, #-16]!
512 ; FAST-LABEL: i64_split 512 ; FAST-LABEL: i64_split
513 ; FAST: ldr x7, [{{x[0-9]+}}] 513 ; FAST: ldr x7, [{{x[0-9]+}}]
514 ; FAST: mov x[[R0:[0-9]+]], sp 514 ; FAST: mov x[[R0:[0-9]+]], sp
515 ; FAST: orr w[[R1:[0-9]+]], wzr, #0x8 515 ; FAST: orr w[[R1:[0-9]+]], wzr, #0x8
516 ; FAST: str w[[R1]], {{\[}}x[[R0]]{{\]}} 516 ; FAST: str w[[R1]], {{\[}}x[[R0]]{{\]}}
517 %0 = load i64* bitcast (%struct.s41* @g41 to i64*), align 16 517 %0 = load i64, i64* bitcast (%struct.s41* @g41 to i64*), align 16
518 %call = tail call i32 @callee_i64(i32 1, i32 2, i32 3, i32 4, i32 5, 518 %call = tail call i32 @callee_i64(i32 1, i32 2, i32 3, i32 4, i32 5,
519 i32 6, i32 7, i64 %0, i32 8) #5 519 i32 6, i32 7, i64 %0, i32 8) #5
520 ret i32 %call 520 ret i32 %call
521 } 521 }
522 522