1 ; RUN: llc -march=mips < %s
2 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 < %s
3 ; RUN: llc -march=mipsel < %s
4 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 < %s
6 ; This test originally failed for MSA after dereferencing a null this pointer.
7 ; It should at least successfully build.
9 define void @autogen_SD2704903805(ptr, ptr, ptr, i32, i64, i8) {
18 %E = extractelement <2 x i16> zeroinitializer, i32 0
19 %Shuff = shufflevector <1 x i8> <i8 -1>, <1 x i8> <i8 -1>, <1 x i32> undef
20 %I = insertelement <1 x i8> <i8 -1>, i8 85, i32 0
21 %B = lshr <2 x i16> zeroinitializer, zeroinitializer
22 %FC = sitofp <4 x i16> zeroinitializer to <4 x float>
23 %Sl = select i1 true, float 0.000000e+00, float 0x401E76A240000000
24 %Cmp = icmp ule i16 -25210, %E
30 %E6 = extractelement <1 x i8> <i8 -1>, i32 0
31 %Shuff7 = shufflevector <2 x i16> zeroinitializer, <2 x i16> zeroinitializer, <2 x i32> <i32 1, i32 3>
32 %I8 = insertelement <4 x i16> zeroinitializer, i16 %E, i32 3
33 %B9 = ashr <2 x i16> %Shuff7, zeroinitializer
34 %FC10 = sitofp i32 -1 to float
35 %Sl11 = select i1 %Cmp, i32 -1, i32 -1
36 %Cmp12 = icmp sgt i32 -1, -1
39 CF: ; preds = %CF, %CF81, %CF83
40 %L13 = load i8, ptr %0
42 %E14 = extractelement <2 x i64> zeroinitializer, i32 0
43 %Shuff15 = shufflevector <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, <4 x i32> <i32 3, i32 5, i32 7, i32 undef>
44 %I16 = insertelement <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, i64 81222, i32 1
45 %B17 = lshr <2 x i16> zeroinitializer, %B
46 %Tr = trunc i32 272597 to i1
47 br i1 %Tr, label %CF, label %CF80
49 CF80: ; preds = %CF80, %CF
50 %Sl18 = select i1 %Cmp, <2 x i64> zeroinitializer, <2 x i64> zeroinitializer
51 %Cmp19 = icmp ne i1 %Cmp12, %Cmp
52 br i1 %Cmp19, label %CF80, label %CF81
55 %L20 = load i8, ptr %0
57 %E21 = extractelement <1 x i8> <i8 -1>, i32 0
58 %Shuff22 = shufflevector <1 x i8> <i8 -1>, <1 x i8> %Shuff, <1 x i32> zeroinitializer
59 %I23 = insertelement <1 x i8> <i8 -1>, i8 %L5, i32 0
60 %FC24 = fptoui <4 x float> %FC to <4 x i16>
61 %Sl25 = select i1 %Cmp, <2 x i32> zeroinitializer, <2 x i32> <i32 -1, i32 -1>
62 %Cmp26 = icmp ult <4 x i64> %I16, %Shuff15
63 %L27 = load i8, ptr %0
65 %E28 = extractelement <1 x i8> <i8 -1>, i32 0
66 %Shuff29 = shufflevector <8 x i16> zeroinitializer, <8 x i16> zeroinitializer, <8 x i32> <i32 11, i32 undef, i32 15, i32 1, i32 3, i32 5, i32 undef, i32 9>
67 %I30 = insertelement <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, i64 %E14, i32 1
68 %B31 = mul i8 %E28, 85
69 %Sl32 = select i1 %Cmp12, float %FC10, float 0x4712BFE680000000
70 %L33 = load i32, ptr %A3
71 store i32 %L33, ptr %A3
72 %E34 = extractelement <2 x i16> zeroinitializer, i32 1
73 %Shuff35 = shufflevector <1 x i8> %Shuff, <1 x i8> <i8 -1>, <1 x i32> zeroinitializer
74 %I36 = insertelement <1 x i8> <i8 -1>, i8 %L13, i32 0
75 %B37 = xor i8 %L27, %L
76 %Sl38 = select i1 %Cmp, i16 %E34, i16 %E
77 %Cmp39 = icmp eq i1 %Cmp19, %Cmp
78 br i1 %Cmp39, label %CF, label %CF77
80 CF77: ; preds = %CF77, %CF81
81 %L40 = load i32, ptr %A3
83 %E41 = extractelement <2 x i32> zeroinitializer, i32 0
84 %Shuff42 = shufflevector <2 x i32> <i32 -1, i32 -1>, <2 x i32> zeroinitializer, <2 x i32> <i32 1, i32 3>
85 %I43 = insertelement <1 x i8> <i8 -1>, i8 0, i32 0
86 %B44 = or i16 %E, -25210
87 %Se = sext i32 %3 to i64
88 %Sl45 = select i1 true, <1 x i8> %Shuff, <1 x i8> %I43
89 %Cmp46 = icmp sge <1 x i8> %I36, %Shuff
90 %L47 = load i32, ptr %A3
91 store i32 %L33, ptr %A3
92 %E48 = extractelement <2 x i16> zeroinitializer, i32 0
93 %Shuff49 = shufflevector <1 x i8> <i8 -1>, <1 x i8> <i8 -1>, <1 x i32> <i32 1>
94 %I50 = insertelement <2 x i32> %Sl25, i32 47963, i32 1
95 %B51 = srem <1 x i8> %I, %Shuff22
96 %FC52 = sitofp i8 %5 to double
97 %Sl53 = select i1 %Cmp39, i8 %L27, i8 85
98 %Cmp54 = icmp slt i16 %E34, %E34
99 br i1 %Cmp54, label %CF77, label %CF78
101 CF78: ; preds = %CF78, %CF77
102 %L55 = load i32, ptr %A3
103 store i32 %L33, ptr %A3
104 %E56 = extractelement <8 x i16> %Shuff29, i32 4
105 %Shuff57 = shufflevector <1 x i8> <i8 -1>, <1 x i8> <i8 -1>, <1 x i32> <i32 1>
106 %I58 = insertelement <1 x i8> %B51, i8 %Sl53, i32 0
107 %ZE = fpext float %FC10 to double
108 %Sl59 = select i1 %Cmp12, <2 x i16> %B9, <2 x i16> zeroinitializer
109 %Cmp60 = fcmp ult double 0.000000e+00, 0.000000e+00
110 br i1 %Cmp60, label %CF78, label %CF79
112 CF79: ; preds = %CF79, %CF78
113 %L61 = load i32, ptr %A3
114 store i32 %L33, ptr %A3
115 %E62 = extractelement <4 x i64> %Shuff15, i32 1
116 %Shuff63 = shufflevector <8 x i16> %Shuff29, <8 x i16> %Shuff29, <8 x i32> <i32 undef, i32 10, i32 12, i32 undef, i32 undef, i32 undef, i32 4, i32 6>
117 %I64 = insertelement <2 x i64> zeroinitializer, i64 %Se, i32 0
119 %ZE66 = zext <4 x i1> %Cmp26 to <4 x i32>
120 %Sl67 = select i1 %Tr, <1 x i8> %Shuff, <1 x i8> %I23
121 %Cmp68 = fcmp olt float 0x4712BFE680000000, 0x4712BFE680000000
122 br i1 %Cmp68, label %CF79, label %CF82
124 CF82: ; preds = %CF79
125 %L69 = load i32, ptr %A3
126 store i32 %L33, ptr %A3
127 %E70 = extractelement <8 x i16> zeroinitializer, i32 3
128 %Shuff71 = shufflevector <4 x i64> %Shuff15, <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, <4 x i32> <i32 6, i32 undef, i32 2, i32 4>
129 %I72 = insertelement <1 x i8> <i8 -1>, i8 %L, i32 0
130 %B73 = srem i64 %E62, %Se
131 %ZE74 = zext <4 x i1> %Cmp26 to <4 x i32>
132 %Sl75 = select i1 %Cmp, i32 463279, i32 %L61
133 %Cmp76 = icmp sgt <1 x i8> %Shuff49, %Shuff22
134 store i8 %B31, ptr %0
136 store i32 %L33, ptr %A3
137 store i8 %B65, ptr %0