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(i8* %c, ...)
73 define void @smallStruct_1b1s(%struct.SmallStruct_1b1s* %ss) #0 {
75 %ss.addr = alloca %struct.SmallStruct_1b1s*, align 8
76 store %struct.SmallStruct_1b1s* %ss, %struct.SmallStruct_1b1s** %ss.addr, align 8
77 %0 = load %struct.SmallStruct_1b1s*, %struct.SmallStruct_1b1s** %ss.addr, align 8
78 %1 = bitcast %struct.SmallStruct_1b1s* %0 to { i32 }*
79 %2 = getelementptr { i32 }, { i32 }* %1, i32 0, i32 0
80 %3 = load i32, i32* %2, align 1
81 call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i32 inreg %3)
83 ; CHECK-LABEL: smallStruct_1b1s:
84 ; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 32
87 define void @smallStruct_1b1i(%struct.SmallStruct_1b1i* %ss) #0 {
89 %ss.addr = alloca %struct.SmallStruct_1b1i*, align 8
90 store %struct.SmallStruct_1b1i* %ss, %struct.SmallStruct_1b1i** %ss.addr, align 8
91 %0 = load %struct.SmallStruct_1b1i*, %struct.SmallStruct_1b1i** %ss.addr, align 8
92 %1 = bitcast %struct.SmallStruct_1b1i* %0 to { i64 }*
93 %2 = getelementptr { i64 }, { i64 }* %1, i32 0, i32 0
94 %3 = load i64, i64* %2, align 1
95 call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i64 inreg %3)
97 ; CHECK-LABEL: smallStruct_1b1i:
102 define void @smallStruct_1b1s1b(%struct.SmallStruct_1b1s1b* %ss) #0 {
104 %ss.addr = alloca %struct.SmallStruct_1b1s1b*, align 8
105 %.coerce = alloca { i48 }
106 store %struct.SmallStruct_1b1s1b* %ss, %struct.SmallStruct_1b1s1b** %ss.addr, align 8
107 %0 = load %struct.SmallStruct_1b1s1b*, %struct.SmallStruct_1b1s1b** %ss.addr, align 8
108 %1 = bitcast { i48 }* %.coerce to i8*
109 %2 = bitcast %struct.SmallStruct_1b1s1b* %0 to i8*
110 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i1 false)
111 %3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
112 %4 = load i48, i48* %3, align 1
113 call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
115 ; CHECK-LABEL: smallStruct_1b1s1b:
116 ; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 16
119 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
121 define void @smallStruct_1s1i(%struct.SmallStruct_1s1i* %ss) #0 {
123 %ss.addr = alloca %struct.SmallStruct_1s1i*, align 8
124 store %struct.SmallStruct_1s1i* %ss, %struct.SmallStruct_1s1i** %ss.addr, align 8
125 %0 = load %struct.SmallStruct_1s1i*, %struct.SmallStruct_1s1i** %ss.addr, align 8
126 %1 = bitcast %struct.SmallStruct_1s1i* %0 to { i64 }*
127 %2 = getelementptr { i64 }, { i64 }* %1, i32 0, i32 0
128 %3 = load i64, i64* %2, align 1
129 call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i64 inreg %3)
131 ; CHECK-LABEL: smallStruct_1s1i:
136 define void @smallStruct_3b1s(%struct.SmallStruct_3b1s* %ss) #0 {
138 %ss.addr = alloca %struct.SmallStruct_3b1s*, align 8
139 %.coerce = alloca { i48 }
140 store %struct.SmallStruct_3b1s* %ss, %struct.SmallStruct_3b1s** %ss.addr, align 8
141 %0 = load %struct.SmallStruct_3b1s*, %struct.SmallStruct_3b1s** %ss.addr, align 8
142 %1 = bitcast { i48 }* %.coerce to i8*
143 %2 = bitcast %struct.SmallStruct_3b1s* %0 to i8*
144 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i1 false)
145 %3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
146 %4 = load i48, i48* %3, align 1
147 call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
149 ; CHECK-LABEL: smallStruct_3b1s:
150 ; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 16