1 ; RUN: llc --march=mips64 -mcpu=mips64r2 < %s | FileCheck %s
3 ; Generated from the C program:
8 ; struct SmallStruct_1b1s {
13 ; struct SmallStruct_1b1i {
18 ; struct SmallStruct_1b1s1b {
24 ; struct SmallStruct_1s1i {
29 ; struct SmallStruct_3b1s {
36 ; void varArgF_SmallStruct(char* c, ...);
38 ; void smallStruct_1b1s(struct SmallStruct_1b1s* ss)
40 ; varArgF_SmallStruct("", *ss);
43 ; void smallStruct_1b1i(struct SmallStruct_1b1i* ss)
45 ; varArgF_SmallStruct("", *ss);
48 ; void smallStruct_1b1s1b(struct SmallStruct_1b1s1b* ss)
50 ; varArgF_SmallStruct("", *ss);
53 ; void smallStruct_1s1i(struct SmallStruct_1s1i* ss)
55 ; varArgF_SmallStruct("", *ss);
58 ; void smallStruct_3b1s(struct SmallStruct_3b1s* ss)
60 ; varArgF_SmallStruct("", *ss);
63 %struct.SmallStruct_1b1s = type { i8, i16 }
64 %struct.SmallStruct_1b1i = type { i8, i32 }
65 %struct.SmallStruct_1b1s1b = type { i8, i16, i8 }
66 %struct.SmallStruct_1s1i = type { i16, i32 }
67 %struct.SmallStruct_3b1s = type { i8, i8, i8, i16 }
69 @.str = private unnamed_addr constant [3 x i8] c"01\00", align 1
71 declare void @varArgF_SmallStruct(ptr %c, ...)
73 define void @smallStruct_1b1s(ptr %ss) #0 {
75 %ss.addr = alloca ptr, align 8
76 store ptr %ss, ptr %ss.addr, align 8
77 %0 = load ptr, ptr %ss.addr, align 8
78 %1 = load i32, ptr %0, align 1
79 call void (ptr, ...) @varArgF_SmallStruct(ptr @.str, i32 inreg %1)
81 ; CHECK-LABEL: smallStruct_1b1s:
82 ; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 32
85 define void @smallStruct_1b1i(ptr %ss) #0 {
87 %ss.addr = alloca ptr, align 8
88 store ptr %ss, ptr %ss.addr, align 8
89 %0 = load ptr, ptr %ss.addr, align 8
90 %1 = load i64, ptr %0, align 1
91 call void (ptr, ...) @varArgF_SmallStruct(ptr @.str, i64 inreg %1)
93 ; CHECK-LABEL: smallStruct_1b1i:
98 define void @smallStruct_1b1s1b(ptr %ss) #0 {
100 %ss.addr = alloca ptr, align 8
101 %.coerce = alloca { i48 }
102 store ptr %ss, ptr %ss.addr, align 8
103 %0 = load ptr, ptr %ss.addr, align 8
104 call void @llvm.memcpy.p0.p0.i64(ptr %.coerce, ptr %0, i64 6, i1 false)
105 %1 = load i48, ptr %.coerce, align 1
106 call void (ptr, ...) @varArgF_SmallStruct(ptr @.str, i48 inreg %1)
108 ; CHECK-LABEL: smallStruct_1b1s1b:
109 ; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 16
112 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1) #1
114 define void @smallStruct_1s1i(ptr %ss) #0 {
116 %ss.addr = alloca ptr, align 8
117 store ptr %ss, ptr %ss.addr, align 8
118 %0 = load ptr, ptr %ss.addr, align 8
119 %1 = load i64, ptr %0, align 1
120 call void (ptr, ...) @varArgF_SmallStruct(ptr @.str, i64 inreg %1)
122 ; CHECK-LABEL: smallStruct_1s1i:
127 define void @smallStruct_3b1s(ptr %ss) #0 {
129 %ss.addr = alloca ptr, align 8
130 %.coerce = alloca { i48 }
131 store ptr %ss, ptr %ss.addr, align 8
132 %0 = load ptr, ptr %ss.addr, align 8
133 call void @llvm.memcpy.p0.p0.i64(ptr %.coerce, ptr %0, i64 6, i1 false)
134 %1 = load i48, ptr %.coerce, align 1
135 call void (ptr, ...) @varArgF_SmallStruct(ptr @.str, i48 inreg %1)
137 ; CHECK-LABEL: smallStruct_3b1s:
138 ; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 16