From ff51bcee4a2b331e3ccda54a06617165813b0572 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 20 Feb 2021 12:07:02 +0000 Subject: [PATCH] [X86] KnownBits - use llvm min/max intrinsics instead of (deprecated) sse intrinsics. NFCI. These are auto-upgraded to the equivalent llvm variants now. --- llvm/test/CodeGen/X86/known-bits-vector.ll | 18 +++++++++--------- llvm/test/CodeGen/X86/known-signbits-vector.ll | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/llvm/test/CodeGen/X86/known-bits-vector.ll b/llvm/test/CodeGen/X86/known-bits-vector.ll index 05bf984..79c56b1 100644 --- a/llvm/test/CodeGen/X86/known-bits-vector.ll +++ b/llvm/test/CodeGen/X86/known-bits-vector.ll @@ -445,14 +445,14 @@ define <4 x float> @knownbits_smax_smin_shuffle_uitofp(<4 x i32> %a0) { ; X64-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,3,3] ; X64-NEXT: vcvtdq2ps %xmm0, %xmm0 ; X64-NEXT: retq - %1 = call <4 x i32> @llvm.x86.sse41.pminsd(<4 x i32> %a0, <4 x i32> ) - %2 = call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %1, <4 x i32> ) + %1 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %a0, <4 x i32> ) + %2 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %1, <4 x i32> ) %3 = shufflevector <4 x i32> %2, <4 x i32> undef, <4 x i32> %4 = uitofp <4 x i32> %3 to <4 x float> ret <4 x float> %4 } -declare <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32>, <4 x i32>) nounwind readnone -declare <4 x i32> @llvm.x86.sse41.pminsd(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) nounwind readnone define <4 x float> @knownbits_umin_shuffle_uitofp(<4 x i32> %a0) { ; X32-LABEL: knownbits_umin_shuffle_uitofp: @@ -468,13 +468,12 @@ define <4 x float> @knownbits_umin_shuffle_uitofp(<4 x i32> %a0) { ; X64-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,3,3] ; X64-NEXT: vcvtdq2ps %xmm0, %xmm0 ; X64-NEXT: retq - %1 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %a0, <4 x i32> ) + %1 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %a0, <4 x i32> ) %2 = shufflevector <4 x i32> %1, <4 x i32> undef, <4 x i32> %3 = uitofp <4 x i32> %2 to <4 x float> ret <4 x float> %3 } -declare <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32>, <4 x i32>) nounwind readnone -declare <4 x i32> @llvm.x86.sse41.pminud(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>) nounwind readnone define <4 x i32> @knownbits_umax_shuffle_ashr(<4 x i32> %a0) { ; X32-LABEL: knownbits_umax_shuffle_ashr: @@ -486,11 +485,12 @@ define <4 x i32> @knownbits_umax_shuffle_ashr(<4 x i32> %a0) { ; X64: # %bb.0: ; X64-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 ; X64-NEXT: retq - %1 = call <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32> %a0, <4 x i32> ) + %1 = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %a0, <4 x i32> ) %2 = shufflevector <4 x i32> %1, <4 x i32> undef, <4 x i32> %3 = ashr <4 x i32> %2, ret <4 x i32> %3 } +declare <4 x i32> @llvm.umax.v4i32(<4 x i32>, <4 x i32>) nounwind readnone define <4 x float> @knownbits_mask_umax_shuffle_uitofp(<4 x i32> %a0) { ; X32-LABEL: knownbits_mask_umax_shuffle_uitofp: @@ -509,7 +509,7 @@ define <4 x float> @knownbits_mask_umax_shuffle_uitofp(<4 x i32> %a0) { ; X64-NEXT: vcvtdq2ps %xmm0, %xmm0 ; X64-NEXT: retq %1 = and <4 x i32> %a0, - %2 = call <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32> %1, <4 x i32> ) + %2 = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %1, <4 x i32> ) %3 = shufflevector <4 x i32> %2, <4 x i32> undef, <4 x i32> %4 = uitofp <4 x i32> %3 to <4 x float> ret <4 x float> %4 diff --git a/llvm/test/CodeGen/X86/known-signbits-vector.ll b/llvm/test/CodeGen/X86/known-signbits-vector.ll index 945e12b..e5d5688 100644 --- a/llvm/test/CodeGen/X86/known-signbits-vector.ll +++ b/llvm/test/CodeGen/X86/known-signbits-vector.ll @@ -558,13 +558,13 @@ define <4 x i32> @signbits_mask_ashr_smax(<4 x i32> %a0, <4 x i32> %a1) { ; X64-AVX2-NEXT: retq %1 = ashr <4 x i32> %a0, %2 = ashr <4 x i32> %a1, - %3 = call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %1, <4 x i32> %2) + %3 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %1, <4 x i32> %2) %4 = shufflevector <4 x i32> %3, <4 x i32> undef, <4 x i32> zeroinitializer %5 = ashr <4 x i32> %4, %6 = and <4 x i32> %5, ret <4 x i32> %6 } -declare <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) nounwind readnone define <4 x i32> @signbits_mask_ashr_smin(<4 x i32> %a0, <4 x i32> %a1) { ; X86-LABEL: signbits_mask_ashr_smin: @@ -616,13 +616,13 @@ define <4 x i32> @signbits_mask_ashr_smin(<4 x i32> %a0, <4 x i32> %a1) { ; X64-AVX2-NEXT: retq %1 = ashr <4 x i32> %a0, %2 = ashr <4 x i32> %a1, - %3 = call <4 x i32> @llvm.x86.sse41.pminsd(<4 x i32> %1, <4 x i32> %2) + %3 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %1, <4 x i32> %2) %4 = shufflevector <4 x i32> %3, <4 x i32> undef, <4 x i32> zeroinitializer %5 = ashr <4 x i32> %4, %6 = and <4 x i32> %5, ret <4 x i32> %6 } -declare <4 x i32> @llvm.x86.sse41.pminsd(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) nounwind readnone define <4 x i32> @signbits_mask_ashr_umax(<4 x i32> %a0, <4 x i32> %a1) { ; X86-LABEL: signbits_mask_ashr_umax: @@ -674,13 +674,13 @@ define <4 x i32> @signbits_mask_ashr_umax(<4 x i32> %a0, <4 x i32> %a1) { ; X64-AVX2-NEXT: retq %1 = ashr <4 x i32> %a0, %2 = ashr <4 x i32> %a1, - %3 = call <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32> %1, <4 x i32> %2) + %3 = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %1, <4 x i32> %2) %4 = shufflevector <4 x i32> %3, <4 x i32> undef, <4 x i32> zeroinitializer %5 = ashr <4 x i32> %4, %6 = and <4 x i32> %5, ret <4 x i32> %6 } -declare <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.umax.v4i32(<4 x i32>, <4 x i32>) nounwind readnone define <4 x i32> @signbits_mask_ashr_umin(<4 x i32> %a0, <4 x i32> %a1) { ; X86-LABEL: signbits_mask_ashr_umin: @@ -732,13 +732,13 @@ define <4 x i32> @signbits_mask_ashr_umin(<4 x i32> %a0, <4 x i32> %a1) { ; X64-AVX2-NEXT: retq %1 = ashr <4 x i32> %a0, %2 = ashr <4 x i32> %a1, - %3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %1, <4 x i32> %2) + %3 = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %1, <4 x i32> %2) %4 = shufflevector <4 x i32> %3, <4 x i32> undef, <4 x i32> zeroinitializer %5 = ashr <4 x i32> %4, %6 = and <4 x i32> %5, ret <4 x i32> %6 } -declare <4 x i32> @llvm.x86.sse41.pminud(<4 x i32>, <4 x i32>) nounwind readnone +declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>) nounwind readnone ; Make sure we can preserve sign bit information into the second basic block ; so we can avoid having to shift bit 0 into bit 7 for each element due to -- 2.7.4