[llvm] a274062 - [X86][SSE] vector-compare-combines.ll - use llvm min/max intrinsics instead of (deprecated) sse intrinsics. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 20 04:17:58 PST 2021


Author: Simon Pilgrim
Date: 2021-02-20T12:16:54Z
New Revision: a274062bd4c9e9eb27c70f58f1938b1ea41798e5

URL: https://github.com/llvm/llvm-project/commit/a274062bd4c9e9eb27c70f58f1938b1ea41798e5
DIFF: https://github.com/llvm/llvm-project/commit/a274062bd4c9e9eb27c70f58f1938b1ea41798e5.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/vector-compare-combines.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/vector-compare-combines.ll b/llvm/test/CodeGen/X86/vector-compare-combines.ll
index e147db5cb36a..ddc07f996fbd 100644
--- a/llvm/test/CodeGen/X86/vector-compare-combines.ll
+++ b/llvm/test/CodeGen/X86/vector-compare-combines.ll
@@ -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


        


More information about the llvm-commits mailing list