1; RUN: opt < %s -msan-check-access-address=0 -S -passes=msan 2>&1 | FileCheck \ 2; RUN: %s 3; REQUIRES: x86-registered-target 4 5target 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" 6target triple = "x86_64-unknown-linux-gnu" 7 8declare <4 x float> @llvm.x86.sse.cmp.ss(<4 x float>, <4 x float>, i8) nounwind readnone 9declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8) nounwind readnone 10declare <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double>, <2 x double>, i8) nounwind readnone 11declare i32 @llvm.x86.sse.comineq.ss(<4 x float>, <4 x float>) nounwind readnone 12declare i32 @llvm.x86.sse2.ucomilt.sd(<2 x double>, <2 x double>) nounwind readnone 13 14 15define <4 x float> @test_sse_cmp_ss(<4 x float> %a, <4 x float> %b) sanitize_memory { 16entry: 17 %0 = tail call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> %a, <4 x float> %b, i8 4) 18 ret <4 x float> %0 19} 20 21; CHECK-LABEL: @test_sse_cmp_ss 22; CHECK: %[[A:.*]] = or <4 x i32> 23; CHECK: %[[B:.*]] = extractelement <4 x i32> %[[A]], i64 0 24; CHECK: %[[C:.*]] = icmp ne i32 %[[B]], 0 25; CHECK: %[[D:.*]] = sext i1 %[[C]] to i128 26; CHECK: %[[E:.*]] = bitcast i128 %[[D]] to <4 x i32> 27; CHECK: store <4 x i32> %[[E]] 28 29 30define <4 x float> @test_sse_cmp_ps(<4 x float> %a, <4 x float> %b) sanitize_memory { 31entry: 32 %0 = tail call <4 x float> @llvm.x86.sse.cmp.ps(<4 x float> %a, <4 x float> %b, i8 4) 33 ret <4 x float> %0 34} 35 36; CHECK-LABEL: @test_sse_cmp_ps 37; CHECK: %[[A:.*]] = or <4 x i32> 38; CHECK: %[[B:.*]] = icmp ne <4 x i32> %[[A]], zeroinitializer 39; CHECK: %[[C:.*]] = sext <4 x i1> %[[B]] to <4 x i32> 40; CHECK: store <4 x i32> %[[C]] 41 42 43define <2 x double> @test_sse2_cmp_sd(<2 x double> %a, <2 x double> %b) sanitize_memory { 44entry: 45 %0 = tail call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> %a, <2 x double> %b, i8 4) 46 ret <2 x double> %0 47} 48 49; CHECK-LABEL: @test_sse2_cmp_sd 50; CHECK: %[[A:.*]] = or <2 x i64> 51; CHECK: %[[B:.*]] = extractelement <2 x i64> %[[A]], i64 0 52; CHECK: %[[C:.*]] = icmp ne i64 %[[B]], 0 53; CHECK: %[[D:.*]] = sext i1 %[[C]] to i128 54; CHECK: %[[E:.*]] = bitcast i128 %[[D]] to <2 x i64> 55; CHECK: store <2 x i64> %[[E]] 56 57 58define i32 @test_sse_comineq_ss(<4 x float> %a, <4 x float> %b) sanitize_memory { 59entry: 60 %0 = tail call i32 @llvm.x86.sse.comineq.ss(<4 x float> %a, <4 x float> %b) 61 ret i32 %0 62} 63 64; CHECK-LABEL: @test_sse_comineq_ss 65; CHECK: %[[A:.*]] = or <4 x i32> 66; CHECK: %[[B:.*]] = extractelement <4 x i32> %[[A]], i64 0 67; CHECK: %[[C:.*]] = icmp ne i32 %[[B]], 0 68; CHECK: %[[D:.*]] = sext i1 %[[C]] to i32 69; CHECK: store i32 %[[D]] 70 71 72define i32 @test_sse2_ucomilt_sd(<2 x double> %a, <2 x double> %b) sanitize_memory { 73entry: 74 %0 = tail call i32 @llvm.x86.sse2.ucomilt.sd(<2 x double> %a, <2 x double> %b) 75 ret i32 %0 76} 77 78; CHECK-LABEL: @test_sse2_ucomilt_sd 79; CHECK: %[[A:.*]] = or <2 x i64> 80; CHECK: %[[B:.*]] = extractelement <2 x i64> %[[A]], i64 0 81; CHECK: %[[C:.*]] = icmp ne i64 %[[B]], 0 82; CHECK: %[[D:.*]] = sext i1 %[[C]] to i32 83; CHECK: store i32 %[[D]] 84