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(ptr, ptr) {
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>, ptr %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(ptr, ptr) {
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = mem[1,1,1,1]
28 ; CHECK-NEXT: pminud {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
31 %2 = load <4 x i32>, ptr %0, align 16
32 %3 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
33 %4 = extractelement <4 x i32> %3, i32 0
34 %5 = extractelement <4 x i32> %3, i32 1
35 %6 = extractelement <4 x i32> %3, i32 2
36 %7 = extractelement <4 x i32> %3, i32 3
37 %8 = bitcast i32 %4 to <2 x i16>
38 %9 = bitcast i32 %5 to <2 x i16>