Debian Codegraph @

llvm/test/Instrumentation/MemorySanitizer/i386/sse-intrinsics-i386.ll

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt %s -S -passes=msan 2>&1 | FileCheck %s
3
4 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "i386-unknown-linux-gnu"
6
7 define <4 x float> @test_x86_sse_cmp_ps(<4 x float> %a0, <4 x float> %a1) #0 {
8 ; CHECK-LABEL: @test_x86_sse_cmp_ps(
9 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
10 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
11 ; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
12 ; CHECK-NEXT: call void @llvm.donothing()
13 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
14 ; CHECK-NEXT: [[TMP4:%.*]] = icmp ne <4 x i32> [[TMP3]], zeroinitializer
15 ; CHECK-NEXT: [[TMP5:%.*]] = sext <4 x i1> [[TMP4]] to <4 x i32>
16 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.cmp.ps(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]], i8 7)
17 ; CHECK-NEXT: store <4 x i32> [[TMP5]], ptr @__msan_retval_tls, align 8
18 ; CHECK-NEXT: ret <4 x float> [[RES]]
19 ;
20 %res = call <4 x float> @llvm.x86.sse.cmp.ps(<4 x float> %a0, <4 x float> %a1, i8 7) ; <<4 x float>> [#uses=1]
21 ret <4 x float> %res
22 }
23 declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8) nounwind readnone
24
25
26 define <4 x float> @test_x86_sse_cmp_ss(<4 x float> %a0, <4 x float> %a1) #0 {
27 ; CHECK-LABEL: @test_x86_sse_cmp_ss(
28 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
29 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
30 ; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
31 ; CHECK-NEXT: call void @llvm.donothing()
32 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
33 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
34 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
35 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i128
36 ; CHECK-NEXT: [[TMP7:%.*]] = bitcast i128 [[TMP6]] to <4 x i32>
37 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]], i8 7)
38 ; CHECK-NEXT: store <4 x i32> [[TMP7]], ptr @__msan_retval_tls, align 8
39 ; CHECK-NEXT: ret <4 x float> [[RES]]
40 ;
41 %res = call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> %a0, <4 x float> %a1, i8 7) ; <<4 x float>> [#uses=1]
42 ret <4 x float> %res
43 }
44 declare <4 x float> @llvm.x86.sse.cmp.ss(<4 x float>, <4 x float>, i8) nounwind readnone
45
46
47 define i32 @test_x86_sse_comieq_ss(<4 x float> %a0, <4 x float> %a1) #0 {
48 ; CHECK-LABEL: @test_x86_sse_comieq_ss(
49 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
50 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
51 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
52 ; CHECK-NEXT: call void @llvm.donothing()
53 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
54 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
55 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
56 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
57 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.comieq.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
58 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
59 ; CHECK-NEXT: ret i32 [[RES]]
60 ;
61 %res = call i32 @llvm.x86.sse.comieq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
62 ret i32 %res
63 }
64 declare i32 @llvm.x86.sse.comieq.ss(<4 x float>, <4 x float>) nounwind readnone
65
66
67 define i32 @test_x86_sse_comige_ss(<4 x float> %a0, <4 x float> %a1) #0 {
68 ; CHECK-LABEL: @test_x86_sse_comige_ss(
69 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
70 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
71 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
72 ; CHECK-NEXT: call void @llvm.donothing()
73 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
74 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
75 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
76 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
77 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.comige.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
78 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
79 ; CHECK-NEXT: ret i32 [[RES]]
80 ;
81 %res = call i32 @llvm.x86.sse.comige.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
82 ret i32 %res
83 }
84 declare i32 @llvm.x86.sse.comige.ss(<4 x float>, <4 x float>) nounwind readnone
85
86
87 define i32 @test_x86_sse_comigt_ss(<4 x float> %a0, <4 x float> %a1) #0 {
88 ; CHECK-LABEL: @test_x86_sse_comigt_ss(
89 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
90 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
91 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
92 ; CHECK-NEXT: call void @llvm.donothing()
93 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
94 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
95 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
96 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
97 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.comigt.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
98 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
99 ; CHECK-NEXT: ret i32 [[RES]]
100 ;
101 %res = call i32 @llvm.x86.sse.comigt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
102 ret i32 %res
103 }
104 declare i32 @llvm.x86.sse.comigt.ss(<4 x float>, <4 x float>) nounwind readnone
105
106
107 define i32 @test_x86_sse_comile_ss(<4 x float> %a0, <4 x float> %a1) #0 {
108 ; CHECK-LABEL: @test_x86_sse_comile_ss(
109 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
110 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
111 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
112 ; CHECK-NEXT: call void @llvm.donothing()
113 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
114 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
115 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
116 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
117 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.comile.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
118 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
119 ; CHECK-NEXT: ret i32 [[RES]]
120 ;
121 %res = call i32 @llvm.x86.sse.comile.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
122 ret i32 %res
123 }
124 declare i32 @llvm.x86.sse.comile.ss(<4 x float>, <4 x float>) nounwind readnone
125
126
127 define i32 @test_x86_sse_comilt_ss(<4 x float> %a0, <4 x float> %a1) #0 {
128 ; CHECK-LABEL: @test_x86_sse_comilt_ss(
129 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
130 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
131 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
132 ; CHECK-NEXT: call void @llvm.donothing()
133 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
134 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
135 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
136 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
137 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.comilt.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
138 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
139 ; CHECK-NEXT: ret i32 [[RES]]
140 ;
141 %res = call i32 @llvm.x86.sse.comilt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
142 ret i32 %res
143 }
144 declare i32 @llvm.x86.sse.comilt.ss(<4 x float>, <4 x float>) nounwind readnone
145
146
147 define i32 @test_x86_sse_comineq_ss(<4 x float> %a0, <4 x float> %a1) #0 {
148 ; CHECK-LABEL: @test_x86_sse_comineq_ss(
149 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
150 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
151 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
152 ; CHECK-NEXT: call void @llvm.donothing()
153 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
154 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
155 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
156 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
157 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.comineq.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
158 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
159 ; CHECK-NEXT: ret i32 [[RES]]
160 ;
161 %res = call i32 @llvm.x86.sse.comineq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
162 ret i32 %res
163 }
164 declare i32 @llvm.x86.sse.comineq.ss(<4 x float>, <4 x float>) nounwind readnone
165
166
167 define i32 @test_x86_sse_cvtss2si(<4 x float> %a0) #0 {
168 ; CHECK-LABEL: @test_x86_sse_cvtss2si(
169 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
170 ; CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
171 ; CHECK-NEXT: call void @llvm.donothing()
172 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x i32> [[TMP1]], i32 0
173 ; CHECK-NEXT: [[_MSCMP:%.*]] = icmp ne i32 [[TMP2]], 0
174 ; CHECK-NEXT: br i1 [[_MSCMP]], label [[TMP6:%.*]], label [[TMP5:%.*]], !prof [[PROF1:![0-9]+]]
175 ; CHECK: 4:
176 ; CHECK-NEXT: call void @__msan_warning_noreturn() #[[ATTR4:[0-9]+]]
177 ; CHECK-NEXT: unreachable
178 ; CHECK: 5:
179 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.cvtss2si(<4 x float> [[A0:%.*]])
180 ; CHECK-NEXT: store i32 0, ptr @__msan_retval_tls, align 8
181 ; CHECK-NEXT: ret i32 [[RES]]
182 ;
183 %res = call i32 @llvm.x86.sse.cvtss2si(<4 x float> %a0) ; <i32> [#uses=1]
184 ret i32 %res
185 }
186 declare i32 @llvm.x86.sse.cvtss2si(<4 x float>) nounwind readnone
187
188
189 define i32 @test_x86_sse_cvttss2si(<4 x float> %a0) #0 {
190 ; CHECK-LABEL: @test_x86_sse_cvttss2si(
191 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
192 ; CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
193 ; CHECK-NEXT: call void @llvm.donothing()
194 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x i32> [[TMP1]], i32 0
195 ; CHECK-NEXT: [[_MSCMP:%.*]] = icmp ne i32 [[TMP2]], 0
196 ; CHECK-NEXT: br i1 [[_MSCMP]], label [[TMP6:%.*]], label [[TMP5:%.*]], !prof [[PROF1]]
197 ; CHECK: 4:
198 ; CHECK-NEXT: call void @__msan_warning_noreturn() #[[ATTR4]]
199 ; CHECK-NEXT: unreachable
200 ; CHECK: 5:
201 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.cvttss2si(<4 x float> [[A0:%.*]])
202 ; CHECK-NEXT: store i32 0, ptr @__msan_retval_tls, align 8
203 ; CHECK-NEXT: ret i32 [[RES]]
204 ;
205 %res = call i32 @llvm.x86.sse.cvttss2si(<4 x float> %a0) ; <i32> [#uses=1]
206 ret i32 %res
207 }
208 declare i32 @llvm.x86.sse.cvttss2si(<4 x float>) nounwind readnone
209
210
211 define void @test_x86_sse_ldmxcsr(ptr %a0) #0 {
212 ; CHECK-LABEL: @test_x86_sse_ldmxcsr(
213 ; CHECK-NEXT: [[TMP1:%.*]] = load i64, ptr @__msan_param_tls, align 8
214 ; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
215 ; CHECK-NEXT: call void @llvm.donothing()
216 ; CHECK-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A0:%.*]] to i64
217 ; CHECK-NEXT: [[TMP3:%.*]] = and i64 [[TMP2]], -2147483649
218 ; CHECK-NEXT: [[TMP4:%.*]] = inttoptr i64 [[TMP3]] to ptr
219 ; CHECK-NEXT: [[_LDMXCSR:%.*]] = load i32, ptr [[TMP4]], align 1
220 ; CHECK-NEXT: [[_MSCMP:%.*]] = icmp ne i64 [[TMP1]], 0
221 ; CHECK-NEXT: [[_MSCMP1:%.*]] = icmp ne i32 [[_LDMXCSR]], 0
222 ; CHECK-NEXT: [[_MSOR:%.*]] = or i1 [[_MSCMP]], [[_MSCMP1]]
223 ; CHECK-NEXT: br i1 [[_MSOR]], label [[TMP6:%.*]], label [[TMP7:%.*]], !prof [[PROF1]]
224 ; CHECK: 6:
225 ; CHECK-NEXT: call void @__msan_warning_noreturn() #[[ATTR4]]
226 ; CHECK-NEXT: unreachable
227 ; CHECK: 7:
228 ; CHECK-NEXT: call void @llvm.x86.sse.ldmxcsr(ptr [[A0]])
229 ; CHECK-NEXT: ret void
230 ;
231 call void @llvm.x86.sse.ldmxcsr(ptr %a0)
232 ret void
233 }
234 declare void @llvm.x86.sse.ldmxcsr(ptr) nounwind
235
236
237
238 define <4 x float> @test_x86_sse_max_ps(<4 x float> %a0, <4 x float> %a1) #0 {
239 ; CHECK-LABEL: @test_x86_sse_max_ps(
240 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
241 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
242 ; CHECK-NEXT: [[TMP3:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
243 ; CHECK-NEXT: call void @llvm.donothing()
244 ; CHECK-NEXT: [[_MSPROP:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
245 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.max.ps(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
246 ; CHECK-NEXT: store <4 x i32> [[_MSPROP]], ptr @__msan_retval_tls, align 8
247 ; CHECK-NEXT: ret <4 x float> [[RES]]
248 ;
249 %res = call <4 x float> @llvm.x86.sse.max.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
250 ret <4 x float> %res
251 }
252 declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>) nounwind readnone
253
254
255 define <4 x float> @test_x86_sse_max_ss(<4 x float> %a0, <4 x float> %a1) #0 {
256 ; CHECK-LABEL: @test_x86_sse_max_ss(
257 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
258 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
259 ; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
260 ; CHECK-NEXT: call void @llvm.donothing()
261 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
262 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> [[TMP3]], <4 x i32> <i32 4, i32 1, i32 2, i32 3>
263 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
264 ; CHECK-NEXT: store <4 x i32> [[TMP4]], ptr @__msan_retval_tls, align 8
265 ; CHECK-NEXT: ret <4 x float> [[RES]]
266 ;
267 %res = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
268 ret <4 x float> %res
269 }
270 declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>) nounwind readnone
271
272
273 define <4 x float> @test_x86_sse_min_ps(<4 x float> %a0, <4 x float> %a1) #0 {
274 ; CHECK-LABEL: @test_x86_sse_min_ps(
275 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
276 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
277 ; CHECK-NEXT: [[TMP3:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
278 ; CHECK-NEXT: call void @llvm.donothing()
279 ; CHECK-NEXT: [[_MSPROP:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
280 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.min.ps(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
281 ; CHECK-NEXT: store <4 x i32> [[_MSPROP]], ptr @__msan_retval_tls, align 8
282 ; CHECK-NEXT: ret <4 x float> [[RES]]
283 ;
284 %res = call <4 x float> @llvm.x86.sse.min.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
285 ret <4 x float> %res
286 }
287 declare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>) nounwind readnone
288
289
290 define <4 x float> @test_x86_sse_min_ss(<4 x float> %a0, <4 x float> %a1) #0 {
291 ; CHECK-LABEL: @test_x86_sse_min_ss(
292 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
293 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
294 ; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
295 ; CHECK-NEXT: call void @llvm.donothing()
296 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
297 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> [[TMP3]], <4 x i32> <i32 4, i32 1, i32 2, i32 3>
298 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
299 ; CHECK-NEXT: store <4 x i32> [[TMP4]], ptr @__msan_retval_tls, align 8
300 ; CHECK-NEXT: ret <4 x float> [[RES]]
301 ;
302 %res = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
303 ret <4 x float> %res
304 }
305 declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>) nounwind readnone
306
307
308 define i32 @test_x86_sse_movmsk_ps(<4 x float> %a0) #0 {
309 ; CHECK-LABEL: @test_x86_sse_movmsk_ps(
310 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
311 ; CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
312 ; CHECK-NEXT: call void @llvm.donothing()
313 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x i32> [[TMP1]] to i128
314 ; CHECK-NEXT: [[_MSCMP:%.*]] = icmp ne i128 [[TMP2]], 0
315 ; CHECK-NEXT: br i1 [[_MSCMP]], label [[TMP6:%.*]], label [[TMP5:%.*]], !prof [[PROF1]]
316 ; CHECK: 4:
317 ; CHECK-NEXT: call void @__msan_warning_noreturn() #[[ATTR4]]
318 ; CHECK-NEXT: unreachable
319 ; CHECK: 5:
320 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.movmsk.ps(<4 x float> [[A0:%.*]])
321 ; CHECK-NEXT: store i32 0, ptr @__msan_retval_tls, align 8
322 ; CHECK-NEXT: ret i32 [[RES]]
323 ;
324 %res = call i32 @llvm.x86.sse.movmsk.ps(<4 x float> %a0) ; <i32> [#uses=1]
325 ret i32 %res
326 }
327 declare i32 @llvm.x86.sse.movmsk.ps(<4 x float>) nounwind readnone
328
329
330
331 define <4 x float> @test_x86_sse_rcp_ps(<4 x float> %a0) #0 {
332 ; CHECK-LABEL: @test_x86_sse_rcp_ps(
333 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
334 ; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
335 ; CHECK-NEXT: call void @llvm.donothing()
336 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.rcp.ps(<4 x float> [[A0:%.*]])
337 ; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr @__msan_retval_tls, align 8
338 ; CHECK-NEXT: ret <4 x float> [[RES]]
339 ;
340 %res = call <4 x float> @llvm.x86.sse.rcp.ps(<4 x float> %a0) ; <<4 x float>> [#uses=1]
341 ret <4 x float> %res
342 }
343 declare <4 x float> @llvm.x86.sse.rcp.ps(<4 x float>) nounwind readnone
344
345
346 define <4 x float> @test_x86_sse_rcp_ss(<4 x float> %a0) #0 {
347 ; CHECK-LABEL: @test_x86_sse_rcp_ss(
348 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
349 ; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
350 ; CHECK-NEXT: call void @llvm.donothing()
351 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.rcp.ss(<4 x float> [[A0:%.*]])
352 ; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr @__msan_retval_tls, align 8
353 ; CHECK-NEXT: ret <4 x float> [[RES]]
354 ;
355 %res = call <4 x float> @llvm.x86.sse.rcp.ss(<4 x float> %a0) ; <<4 x float>> [#uses=1]
356 ret <4 x float> %res
357 }
358 declare <4 x float> @llvm.x86.sse.rcp.ss(<4 x float>) nounwind readnone
359
360
361 define <4 x float> @test_x86_sse_rsqrt_ps(<4 x float> %a0) #0 {
362 ; CHECK-LABEL: @test_x86_sse_rsqrt_ps(
363 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
364 ; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
365 ; CHECK-NEXT: call void @llvm.donothing()
366 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float> [[A0:%.*]])
367 ; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr @__msan_retval_tls, align 8
368 ; CHECK-NEXT: ret <4 x float> [[RES]]
369 ;
370 %res = call <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float> %a0) ; <<4 x float>> [#uses=1]
371 ret <4 x float> %res
372 }
373 declare <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float>) nounwind readnone
374
375
376 define <4 x float> @test_x86_sse_rsqrt_ss(<4 x float> %a0) #0 {
377 ; CHECK-LABEL: @test_x86_sse_rsqrt_ss(
378 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
379 ; CHECK-NEXT: [[TMP2:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
380 ; CHECK-NEXT: call void @llvm.donothing()
381 ; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float> [[A0:%.*]])
382 ; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr @__msan_retval_tls, align 8
383 ; CHECK-NEXT: ret <4 x float> [[RES]]
384 ;
385 %res = call <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float> %a0) ; <<4 x float>> [#uses=1]
386 ret <4 x float> %res
387 }
388 declare <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float>) nounwind readnone
389
390
391 define void @test_x86_sse_stmxcsr(ptr %a0) #0 {
392 ; CHECK-LABEL: @test_x86_sse_stmxcsr(
393 ; CHECK-NEXT: [[TMP1:%.*]] = load i64, ptr @__msan_param_tls, align 8
394 ; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
395 ; CHECK-NEXT: call void @llvm.donothing()
396 ; CHECK-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A0:%.*]] to i64
397 ; CHECK-NEXT: [[TMP3:%.*]] = and i64 [[TMP2]], -2147483649
398 ; CHECK-NEXT: [[TMP4:%.*]] = inttoptr i64 [[TMP3]] to ptr
399 ; CHECK-NEXT: store i32 0, ptr [[TMP4]], align 4
400 ; CHECK-NEXT: [[_MSCMP:%.*]] = icmp ne i64 [[TMP1]], 0
401 ; CHECK-NEXT: br i1 [[_MSCMP]], label [[TMP6:%.*]], label [[TMP7:%.*]], !prof [[PROF1]]
402 ; CHECK: 6:
403 ; CHECK-NEXT: call void @__msan_warning_noreturn() #[[ATTR4]]
404 ; CHECK-NEXT: unreachable
405 ; CHECK: 7:
406 ; CHECK-NEXT: call void @llvm.x86.sse.stmxcsr(ptr [[A0]])
407 ; CHECK-NEXT: ret void
408 ;
409 call void @llvm.x86.sse.stmxcsr(ptr %a0)
410 ret void
411 }
412 declare void @llvm.x86.sse.stmxcsr(ptr) nounwind
413
414
415 define i32 @test_x86_sse_ucomieq_ss(<4 x float> %a0, <4 x float> %a1) #0 {
416 ; CHECK-LABEL: @test_x86_sse_ucomieq_ss(
417 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
418 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
419 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
420 ; CHECK-NEXT: call void @llvm.donothing()
421 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
422 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
423 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
424 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
425 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.ucomieq.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
426 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
427 ; CHECK-NEXT: ret i32 [[RES]]
428 ;
429 %res = call i32 @llvm.x86.sse.ucomieq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
430 ret i32 %res
431 }
432 declare i32 @llvm.x86.sse.ucomieq.ss(<4 x float>, <4 x float>) nounwind readnone
433
434
435 define i32 @test_x86_sse_ucomige_ss(<4 x float> %a0, <4 x float> %a1) #0 {
436 ; CHECK-LABEL: @test_x86_sse_ucomige_ss(
437 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
438 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
439 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
440 ; CHECK-NEXT: call void @llvm.donothing()
441 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
442 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
443 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
444 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
445 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.ucomige.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
446 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
447 ; CHECK-NEXT: ret i32 [[RES]]
448 ;
449 %res = call i32 @llvm.x86.sse.ucomige.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
450 ret i32 %res
451 }
452 declare i32 @llvm.x86.sse.ucomige.ss(<4 x float>, <4 x float>) nounwind readnone
453
454
455 define i32 @test_x86_sse_ucomigt_ss(<4 x float> %a0, <4 x float> %a1) #0 {
456 ; CHECK-LABEL: @test_x86_sse_ucomigt_ss(
457 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
458 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
459 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
460 ; CHECK-NEXT: call void @llvm.donothing()
461 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
462 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
463 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
464 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
465 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.ucomigt.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
466 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
467 ; CHECK-NEXT: ret i32 [[RES]]
468 ;
469 %res = call i32 @llvm.x86.sse.ucomigt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
470 ret i32 %res
471 }
472 declare i32 @llvm.x86.sse.ucomigt.ss(<4 x float>, <4 x float>) nounwind readnone
473
474
475 define i32 @test_x86_sse_ucomile_ss(<4 x float> %a0, <4 x float> %a1) #0 {
476 ; CHECK-LABEL: @test_x86_sse_ucomile_ss(
477 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
478 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
479 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
480 ; CHECK-NEXT: call void @llvm.donothing()
481 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
482 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
483 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
484 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
485 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.ucomile.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
486 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
487 ; CHECK-NEXT: ret i32 [[RES]]
488 ;
489 %res = call i32 @llvm.x86.sse.ucomile.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
490 ret i32 %res
491 }
492 declare i32 @llvm.x86.sse.ucomile.ss(<4 x float>, <4 x float>) nounwind readnone
493
494
495 define i32 @test_x86_sse_ucomilt_ss(<4 x float> %a0, <4 x float> %a1) #0 {
496 ; CHECK-LABEL: @test_x86_sse_ucomilt_ss(
497 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
498 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
499 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
500 ; CHECK-NEXT: call void @llvm.donothing()
501 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
502 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
503 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
504 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
505 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.ucomilt.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
506 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
507 ; CHECK-NEXT: ret i32 [[RES]]
508 ;
509 %res = call i32 @llvm.x86.sse.ucomilt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
510 ret i32 %res
511 }
512 declare i32 @llvm.x86.sse.ucomilt.ss(<4 x float>, <4 x float>) nounwind readnone
513
514
515 define i32 @test_x86_sse_ucomineq_ss(<4 x float> %a0, <4 x float> %a1) #0 {
516 ; CHECK-LABEL: @test_x86_sse_ucomineq_ss(
517 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr @__msan_param_tls, align 8
518 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, ptr getelementptr (i8, ptr @__msan_param_tls, i64 16), align 8
519 ; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
520 ; CHECK-NEXT: call void @llvm.donothing()
521 ; CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP1]], [[TMP2]]
522 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x i32> [[TMP3]], i64 0
523 ; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP4]], 0
524 ; CHECK-NEXT: [[TMP6:%.*]] = sext i1 [[TMP5]] to i32
525 ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.x86.sse.ucomineq.ss(<4 x float> [[A0:%.*]], <4 x float> [[A1:%.*]])
526 ; CHECK-NEXT: store i32 [[TMP6]], ptr @__msan_retval_tls, align 8
527 ; CHECK-NEXT: ret i32 [[RES]]
528 ;
529 %res = call i32 @llvm.x86.sse.ucomineq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
530 ret i32 %res
531 }
532 declare i32 @llvm.x86.sse.ucomineq.ss(<4 x float>, <4 x float>) nounwind readnone
533
534
535 define void @sfence() nounwind {
536 ; CHECK-LABEL: @sfence(
537 ; CHECK-NEXT: [[TMP1:%.*]] = load i64, ptr @__msan_va_arg_overflow_size_tls, align 8
538 ; CHECK-NEXT: call void @llvm.donothing()
539 ; CHECK-NEXT: tail call void @llvm.x86.sse.sfence()
540 ; CHECK-NEXT: ret void
541 ;
542 tail call void @llvm.x86.sse.sfence()
543 ret void
544 }
545 declare void @llvm.x86.sse.sfence() nounwind
546
547 attributes #0 = { sanitize_memory }