[llvm] r363693 - [X86][AVX] extract_subvector(any_extend(x)) -> any_extend_vector_inreg(x)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 18 08:30:50 PDT 2019
Author: rksimon
Date: Tue Jun 18 08:30:50 2019
New Revision: 363693
URL: http://llvm.org/viewvc/llvm-project?rev=363693&view=rev
Log:
[X86][AVX] extract_subvector(any_extend(x)) -> any_extend_vector_inreg(x)
Part of fixing the X86 regression noted in D63281 - I've split this into X86 and generic parts - the generic commit will be coming shortly and will fix the vector-reduce-mul-widen.ll regression introduced here.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/vector-reduce-mul-widen.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=363693&r1=363692&r2=363693&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jun 18 08:30:50 2019
@@ -6875,6 +6875,7 @@ static bool getFauxShuffleMask(SDValue N
return true;
}
case ISD::ZERO_EXTEND:
+ case ISD::ANY_EXTEND:
case ISD::ZERO_EXTEND_VECTOR_INREG:
case ISD::ANY_EXTEND_VECTOR_INREG: {
SDValue Src = N.getOperand(0);
@@ -6886,7 +6887,8 @@ static bool getFauxShuffleMask(SDValue N
return false;
unsigned NumSrcBitsPerElt = SrcVT.getScalarSizeInBits();
- bool IsAnyExtend = (ISD::ANY_EXTEND_VECTOR_INREG == Opcode);
+ bool IsAnyExtend =
+ (ISD::ANY_EXTEND == Opcode || ISD::ANY_EXTEND_VECTOR_INREG == Opcode);
DecodeZeroExtendMask(NumSrcBitsPerElt, NumBitsPerElt, NumElts, IsAnyExtend,
Mask);
@@ -43541,9 +43543,13 @@ static SDValue combineExtractSubvector(S
InOpcode == ISD::SIGN_EXTEND) &&
VT.is128BitVector() &&
InVec.getOperand(0).getSimpleValueType().is128BitVector()) {
- unsigned ExtOp = InOpcode == ISD::SIGN_EXTEND
- ? ISD::SIGN_EXTEND_VECTOR_INREG
- : ISD::ZERO_EXTEND_VECTOR_INREG;
+ unsigned ExtOp;
+ switch(InOpcode) {
+ default: llvm_unreachable("Unknown extension opcode");
+ case ISD::ANY_EXTEND: ExtOp = ISD::ANY_EXTEND_VECTOR_INREG; break;
+ case ISD::SIGN_EXTEND: ExtOp = ISD::SIGN_EXTEND_VECTOR_INREG; break;
+ case ISD::ZERO_EXTEND: ExtOp = ISD::ZERO_EXTEND_VECTOR_INREG; break;
+ }
return DAG.getNode(ExtOp, SDLoc(N), VT, InVec.getOperand(0));
}
if ((InOpcode == ISD::ANY_EXTEND_VECTOR_INREG ||
Modified: llvm/trunk/test/CodeGen/X86/vector-reduce-mul-widen.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vector-reduce-mul-widen.ll?rev=363693&r1=363692&r2=363693&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vector-reduce-mul-widen.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vector-reduce-mul-widen.ll Tue Jun 18 08:30:50 2019
@@ -1837,6 +1837,7 @@ define i8 @test_v16i8(<16 x i8> %a0) {
; AVX2-NEXT: vpand %xmm1, %xmm0, %xmm0
; AVX2-NEXT: vpackuswb %xmm0, %xmm0, %xmm1
; AVX2-NEXT: vpsrlw $8, %xmm1, %xmm1
+; AVX2-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
; AVX2-NEXT: vpmullw %xmm1, %xmm0, %xmm0
; AVX2-NEXT: vpextrb $0, %xmm0, %eax
; AVX2-NEXT: # kill: def $al killed $al killed $eax
More information about the llvm-commits
mailing list