1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -verify-machineinstrs -stop-before=ppc-vsx-copy -vec-extabi \
3 ; RUN: -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff < %s | \
6 ;; Testing a variadic callee where a vector argument passed through ellipsis
7 ;; is passed partially in registers and on the stack. The 3 fixed double
8 ;; arguments shadow r3-r8, and a vector int <4 x i32> is passed in R9/R10 and
9 ;; on the stack starting at the shadow of R9.
10 define <4 x i32> @split_spill(double %d1, double %d2, double %d3, ...) {
11 ; CHECK-LABEL: name: split_spill
13 ; CHECK: liveins: $r9, $r10
14 ; CHECK: [[COPY:%[0-9]+]]:gprc = COPY $r10
15 ; CHECK: [[COPY1:%[0-9]+]]:gprc = COPY $r9
16 ; CHECK: STW [[COPY1]], 0, %fixed-stack.0 :: (store (s32) into %fixed-stack.0, align 16)
17 ; CHECK: STW [[COPY]], 4, %fixed-stack.0 :: (store (s32) into %fixed-stack.0 + 4)
18 ; CHECK: LIFETIME_START %stack.0.arg_list
19 ; CHECK: [[ADDI:%[0-9]+]]:gprc = ADDI %fixed-stack.0, 0
20 ; CHECK: [[LXVW4X:%[0-9]+]]:vsrc = LXVW4X $zero, killed [[ADDI]] :: (load (s128) from %ir.4)
21 ; CHECK: LIFETIME_END %stack.0.arg_list
22 ; CHECK: $v2 = COPY [[LXVW4X]]
23 ; CHECK: BLR implicit $lr, implicit $rm, implicit $v2
25 %arg_list = alloca i8*, align 4
26 %0 = bitcast i8** %arg_list to i8*
27 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0)
28 call void @llvm.va_start(i8* nonnull %0)
29 %argp.cur = load i8*, i8** %arg_list, align 4
30 %1 = ptrtoint i8* %argp.cur to i32
33 %argp.cur.aligned = inttoptr i32 %3 to i8*
34 %argp.next = getelementptr inbounds i8, i8* %argp.cur.aligned, i32 16
35 store i8* %argp.next, i8** %arg_list, align 4
36 %4 = inttoptr i32 %3 to <4 x i32>*
37 %5 = load <4 x i32>, <4 x i32>* %4, align 16
38 call void @llvm.va_end(i8* nonnull %0)
39 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0)
43 declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
45 declare void @llvm.va_start(i8*)
47 declare void @llvm.va_end(i8*)
49 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)