1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux-pc -mcpu=corei7 | FileCheck %s
4 declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>)
6 define <2 x i16> @good(<4 x i32>*, <4 x i8>*) {
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: movdqa (%rdi), %xmm0
10 ; CHECK-NEXT: pminud {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
13 %2 = load <4 x i32>, <4 x i32>* %0, align 16
14 %3 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
15 %4 = extractelement <4 x i32> %3, i32 0
16 %5 = extractelement <4 x i32> %3, i32 1
17 %6 = extractelement <4 x i32> %3, i32 2
18 %7 = extractelement <4 x i32> %3, i32 3
19 %8 = bitcast i32 %4 to <2 x i16>
20 %9 = bitcast i32 %5 to <2 x i16>
24 define <2 x i16> @bad(<4 x i32>*, <4 x i8>*) {
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: movdqa (%rdi), %xmm0
28 ; CHECK-NEXT: pminud {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
29 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,1,1]
32 %2 = load <4 x i32>, <4 x i32>* %0, align 16
33 %3 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
34 %4 = extractelement <4 x i32> %3, i32 0
35 %5 = extractelement <4 x i32> %3, i32 1
36 %6 = extractelement <4 x i32> %3, i32 2
37 %7 = extractelement <4 x i32> %3, i32 3
38 %8 = bitcast i32 %4 to <2 x i16>
39 %9 = bitcast i32 %5 to <2 x i16>