1 ; RUN: opt < %s -msan-check-access-address=0 -S -passes=msan 2>&1 | FileCheck %s --implicit-check-not="call void @__msan_warning"
3 ; REQUIRES: x86-registered-target
5 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
8 declare i32 @llvm.x86.sse2.cvtsd2si(<2 x double>) nounwind readnone
9 declare <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double>, i32) nounwind readnone
10 declare <1 x i64> @llvm.x86.sse.cvtps2pi(<4 x float>) nounwind readnone
11 declare i32 @llvm.x86.avx512.vcvtss2usi32(<4 x float>, i32) nounwind readnone
13 ; Single argument vector conversion.
15 define i32 @test_cvtsd2si(<2 x double> %value) sanitize_memory {
17 %0 = tail call i32 @llvm.x86.sse2.cvtsd2si(<2 x double> %value)
21 ; CHECK-LABEL: @test_cvtsd2si
22 ; CHECK: [[S:%[_01-9a-z]+]] = extractelement <2 x i64> {{.*}}, i32 0
23 ; CHECK: icmp ne {{.*}}[[S]], 0
25 ; CHECK: call void @__msan_warning_noreturn()
26 ; CHECK: call i32 @llvm.x86.sse2.cvtsd2si
27 ; CHECK: store i32 0, {{.*}} @__msan_retval_tls
30 ; <1 x i64> packed vector conversion.
32 define <1 x i64> @test_cvtps2pi(<4 x float> %value) sanitize_memory {
34 %0 = tail call <1 x i64> @llvm.x86.sse.cvtps2pi(<4 x float> %value)
38 ; CHECK-LABEL: @test_cvtps2pi
39 ; CHECK: extractelement <4 x i32> {{.*}}, i32 0
40 ; CHECK: extractelement <4 x i32> {{.*}}, i32 1
41 ; CHECK: [[S:%[_01-9a-z]+]] = or i32
42 ; CHECK: icmp ne {{.*}}[[S]], 0
44 ; CHECK: call void @__msan_warning_noreturn()
45 ; CHECK: call <1 x i64> @llvm.x86.sse.cvtps2pi
46 ; CHECK: store <1 x i64> zeroinitializer, {{.*}} @__msan_retval_tls
47 ; CHECK: ret <1 x i64>
49 ; avx512 rounding conversion.
51 define i32 @pr48298(<4 x float> %value) sanitize_memory {
53 %0 = tail call i32 @llvm.x86.avx512.vcvtss2usi32(<4 x float> %value, i32 11)
57 ; CHECK-LABEL: @pr48298
58 ; CHECK: extractelement <4 x i32> {{.*}}, i32 0
59 ; CHECK: icmp ne i32 {{.*}}, 0
61 ; CHECK: call void @__msan_warning_noreturn()
62 ; CHECK: call i32 @llvm.x86.avx512.vcvtss2usi32
63 ; CHECK: store i32 0, {{.*}} @__msan_retval_tls