[llvm] r313547 - [X86][AVX] Improve (i8 bitcast (v8i1 x)) handling for 256-bit vector compare results.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 10:58:31 PDT 2017
Author: rksimon
Date: Mon Sep 18 10:58:31 2017
New Revision: 313547
URL: http://llvm.org/viewvc/llvm-project?rev=313547&view=rev
Log:
[X86][AVX] Improve (i8 bitcast (v8i1 x)) handling for 256-bit vector compare results.
As commented on D37849, AVX1 targets were missing a chance to use vmovmskps for v8f32/v8i32 results for bool vector bitcasts
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=313547&r1=313546&r2=313547&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 18 10:58:31 2017
@@ -29392,7 +29392,7 @@ static SDValue combineBitcastvxi1(Select
// the compare.
if (N0->getOpcode() == ISD::SETCC &&
N0->getOperand(0)->getValueType(0).is256BitVector() &&
- Subtarget.hasInt256()) {
+ Subtarget.hasAVX()) {
SExtVT = MVT::v8i32;
FPCastVT = MVT::v8f32;
}
Modified: llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll?rev=313547&r1=313546&r2=313547&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll Mon Sep 18 10:58:31 2017
@@ -77,9 +77,8 @@ define i8 @v8i32(<8 x i32> %a, <8 x i32>
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
; AVX1-NEXT: vpcmpgtd %xmm2, %xmm3, %xmm2
; AVX1-NEXT: vpcmpgtd %xmm1, %xmm0, %xmm0
-; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
-; AVX1-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u]
-; AVX1-NEXT: vpmovmskb %xmm0, %eax
+; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
+; AVX1-NEXT: vmovmskps %ymm0, %eax
; AVX1-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX1-NEXT: vzeroupper
; AVX1-NEXT: retq
@@ -126,24 +125,13 @@ define i8 @v8f32(<8 x float> %a, <8 x fl
; SSSE3-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; SSSE3-NEXT: retq
;
-; AVX1-LABEL: v8f32:
-; AVX1: # BB#0:
-; AVX1-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
-; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
-; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
-; AVX1-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u]
-; AVX1-NEXT: vpmovmskb %xmm0, %eax
-; AVX1-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX1-NEXT: vzeroupper
-; AVX1-NEXT: retq
-;
-; AVX2-LABEL: v8f32:
-; AVX2: # BB#0:
-; AVX2-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
-; AVX2-NEXT: vmovmskps %ymm0, %eax
-; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX2-NEXT: vzeroupper
-; AVX2-NEXT: retq
+; AVX12-LABEL: v8f32:
+; AVX12: # BB#0:
+; AVX12-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
+; AVX12-NEXT: vmovmskps %ymm0, %eax
+; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX12-NEXT: vzeroupper
+; AVX12-NEXT: retq
;
; AVX512-LABEL: v8f32:
; AVX512: # BB#0:
More information about the llvm-commits
mailing list