forked from OSchip/llvm-project
[X86][SSE] vector-compare-combines.ll - use llvm min/max intrinsics instead of (deprecated) sse intrinsics. NFCI.
These are auto-upgraded to the equivalent llvm variants now.
This commit is contained in:
parent
75e66b88bd
commit
a274062bd4
|
@ -2,10 +2,9 @@
|
|||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=SSE
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX
|
||||
|
||||
; If we have SSE/AVX intrinsics in the code, we miss obvious combines
|
||||
; unless we do them late on X86-specific nodes.
|
||||
; Ensure we match legal min/max intrinsics and the expanded compare+select equivalents.
|
||||
|
||||
declare <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32>, <4 x i32>)
|
||||
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
|
||||
|
||||
define <4 x i32> @PR27924_cmpeq(<4 x i32> %a, <4 x i32> %b) {
|
||||
; SSE-LABEL: PR27924_cmpeq:
|
||||
|
@ -19,7 +18,7 @@ define <4 x i32> @PR27924_cmpeq(<4 x i32> %a, <4 x i32> %b) {
|
|||
; AVX-NEXT: retq
|
||||
%cmp = icmp sgt <4 x i32> %a, %b
|
||||
%max = select <4 x i1> %cmp, <4 x i32> %a, <4 x i32> %b
|
||||
%sse_max = tail call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %a, <4 x i32> %b)
|
||||
%sse_max = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %a, <4 x i32> %b)
|
||||
%truth = icmp eq <4 x i32> %max, %sse_max
|
||||
%ret = sext <4 x i1> %truth to <4 x i32>
|
||||
ret <4 x i32> %ret
|
||||
|
@ -37,7 +36,7 @@ define <4 x i32> @PR27924_cmpgt(<4 x i32> %a, <4 x i32> %b) {
|
|||
; AVX-NEXT: retq
|
||||
%cmp = icmp sgt <4 x i32> %a, %b
|
||||
%max = select <4 x i1> %cmp, <4 x i32> %a, <4 x i32> %b
|
||||
%sse_max = tail call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %a, <4 x i32> %b)
|
||||
%sse_max = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %a, <4 x i32> %b)
|
||||
%untruth = icmp sgt <4 x i32> %max, %sse_max
|
||||
%ret = sext <4 x i1> %untruth to <4 x i32>
|
||||
ret <4 x i32> %ret
|
||||
|
|
Loading…
Reference in New Issue