1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=SSE --check-prefix=SSE42
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX --check-prefix=AVX1
5 ; If we have SSE/AVX intrinsics in the code, we miss obvious combines
6 ; unless we do them late on X86-specific nodes.
8 declare <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32>, <4 x i32>)
10 define <4 x i32> @PR27924_cmpeq(<4 x i32> %a, <4 x i32> %b) {
11 ; SSE-LABEL: PR27924_cmpeq:
13 ; SSE-NEXT: pcmpeqd %xmm0, %xmm0
16 ; AVX-LABEL: PR27924_cmpeq:
18 ; AVX-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
20 %cmp = icmp sgt <4 x i32> %a, %b
21 %max = select <4 x i1> %cmp, <4 x i32> %a, <4 x i32> %b
22 %sse_max = tail call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %a, <4 x i32> %b)
23 %truth = icmp eq <4 x i32> %max, %sse_max
24 %ret = sext <4 x i1> %truth to <4 x i32>
28 define <4 x i32> @PR27924_cmpgt(<4 x i32> %a, <4 x i32> %b) {
29 ; SSE-LABEL: PR27924_cmpgt:
31 ; SSE-NEXT: xorps %xmm0, %xmm0
34 ; AVX-LABEL: PR27924_cmpgt:
36 ; AVX-NEXT: vxorps %xmm0, %xmm0, %xmm0
38 %cmp = icmp sgt <4 x i32> %a, %b
39 %max = select <4 x i1> %cmp, <4 x i32> %a, <4 x i32> %b
40 %sse_max = tail call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %a, <4 x i32> %b)
41 %untruth = icmp sgt <4 x i32> %max, %sse_max
42 %ret = sext <4 x i1> %untruth to <4 x i32>