[llvm] r337566 - [X86][AVX] Add support for i16 256-bit vector horizontal op redundant shuffle removal
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 20 08:51:01 PDT 2018
Author: rksimon
Date: Fri Jul 20 08:51:01 2018
New Revision: 337566
URL: http://llvm.org/viewvc/llvm-project?rev=337566&view=rev
Log:
[X86][AVX] Add support for i16 256-bit vector horizontal op redundant shuffle removal
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/haddsub-shuf.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=337566&r1=337565&r2=337566&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jul 20 08:51:01 2018
@@ -31164,7 +31164,9 @@ static SDValue foldShuffleOfHorizOp(SDNo
if (HOp.getValueSizeInBits() == 256 &&
(isTargetShuffleEquivalent(Mask, {0, 0, 2, 2}) ||
- isTargetShuffleEquivalent(Mask, {0, 1, 0, 1, 4, 5, 4, 5})))
+ isTargetShuffleEquivalent(Mask, {0, 1, 0, 1, 4, 5, 4, 5}) ||
+ isTargetShuffleEquivalent(
+ Mask, {0, 1, 2, 3, 0, 1, 2, 3, 8, 9, 10, 11, 8, 9, 10, 11})))
return HOp;
return SDValue();
Modified: llvm/trunk/test/CodeGen/X86/haddsub-shuf.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/haddsub-shuf.ll?rev=337566&r1=337565&r2=337566&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/haddsub-shuf.ll (original)
+++ llvm/trunk/test/CodeGen/X86/haddsub-shuf.ll Fri Jul 20 08:51:01 2018
@@ -432,7 +432,6 @@ define <16 x i16> @hadd_v16i16b(<16 x i1
; AVX2-LABEL: hadd_v16i16b:
; AVX2: # %bb.0:
; AVX2-NEXT: vphaddw %ymm0, %ymm0, %ymm0
-; AVX2-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
; AVX2-NEXT: retq
%a0 = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 undef, i32 undef, i32 undef, i32 undef, i32 8, i32 10, i32 12, i32 14, i32 undef, i32 undef, i32 undef, i32 undef>
%a1 = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> <i32 1, i32 3, i32 5, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 9, i32 11, i32 13, i32 15, i32 undef, i32 undef, i32 undef, i32 undef>
@@ -513,7 +512,6 @@ define <16 x i16> @hsub_v16i16b(<16 x i1
; AVX2-LABEL: hsub_v16i16b:
; AVX2: # %bb.0:
; AVX2-NEXT: vphsubw %ymm0, %ymm0, %ymm0
-; AVX2-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
; AVX2-NEXT: retq
%a0 = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 undef, i32 undef, i32 undef, i32 undef, i32 8, i32 10, i32 12, i32 14, i32 undef, i32 undef, i32 undef, i32 undef>
%a1 = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> <i32 1, i32 3, i32 5, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 9, i32 11, i32 13, i32 15, i32 undef, i32 undef, i32 undef, i32 undef>
More information about the llvm-commits
mailing list