diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-08 18:40:50 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-08 18:40:50 +0000 |
commit | 6fc8d055656bf6e278dc50973672594ddd9f5edf (patch) | |
tree | f5de5663c82564ea3f825a01d4727a5b166ed901 /llvm/lib/Target | |
parent | 869e5d1fca1caaddfc6c3f8fc7de447e874f49ee (diff) | |
download | bcm5719-llvm-6fc8d055656bf6e278dc50973672594ddd9f5edf.tar.gz bcm5719-llvm-6fc8d055656bf6e278dc50973672594ddd9f5edf.zip |
[X86][AVX2] Enable ZERO_EXTEND_VECTOR_INREG lowering of 256-bit vectors
Some necessary yak shaving before lowering *_EXTEND_VECTOR_INREG 256-bit vectors on AVX1 targets as suggested by D52964.
Differential Revision: https://reviews.llvm.org/D52970
llvm-svn: 343991
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index ef8bf06c173..556dcd3f402 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1125,9 +1125,10 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, } if (HasInt256) { - setOperationAction(ISD::SIGN_EXTEND_VECTOR_INREG, MVT::v4i64, Custom); - setOperationAction(ISD::SIGN_EXTEND_VECTOR_INREG, MVT::v8i32, Custom); - setOperationAction(ISD::SIGN_EXTEND_VECTOR_INREG, MVT::v16i16, Custom); + for (auto VT : { MVT::v16i16, MVT::v8i32, MVT::v4i64 }) { + setOperationAction(ISD::SIGN_EXTEND_VECTOR_INREG, VT, Custom); + setOperationAction(ISD::ZERO_EXTEND_VECTOR_INREG, VT, Custom); + } // The custom lowering for UINT_TO_FP for v8i32 becomes interesting // when we have a 256bit-wide blend with immediate. @@ -19727,10 +19728,7 @@ static SDValue LowerEXTEND_VECTOR_INREG(SDValue Op, In = extractSubVector(In, 0, DAG, dl, std::max(InSize, 128)); } - assert((Op.getOpcode() != ISD::ZERO_EXTEND_VECTOR_INREG || - InVT == MVT::v64i8) && "Zero extend only for v64i8 input!"); - - // SSE41 targets can use the pmovsx* instructions directly for 128-bit results, + // SSE41 targets can use the pmov[sz]x* instructions directly for 128-bit results, // so are legal and shouldn't occur here. AVX2/AVX512 pmovsx* instructions still // need to be handled here for 256/512-bit results. if (Subtarget.hasInt256()) { |