summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2017-01-09 15:15:45 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2017-01-09 15:15:45 +0000
commitd990cd371b82e57cb5aee3602d601a0491ac2104 (patch)
treeaf7ec8886a66f75483f195b2741ab93316c15ab9 /llvm/lib
parentf8538572ab1cac42f50769a7afb6a55be4e1a6b9 (diff)
downloadbcm5719-llvm-d990cd371b82e57cb5aee3602d601a0491ac2104.tar.gz
bcm5719-llvm-d990cd371b82e57cb5aee3602d601a0491ac2104.zip
[X86][AVX512DQ] Enable v16i16 vector shifts to use an extend+shift+truncate pattern.
Use the existing AVX2 v8i16 vector shift lowering for v16i16 on AVX512 targets (AVX512BW will have already have lowered with vpsravw). Cost model updates to follow. llvm-svn: 291445
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index b41d9f45490..66f1959c035 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -21653,11 +21653,12 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
}
}
- // It's worth extending once and using the v8i32 shifts for 16-bit types, but
+ // It's worth extending once and using the vXi32 shifts for 16-bit types, but
// the extra overheads to get from v16i8 to v8i32 make the existing SSE
// solution better.
- if (Subtarget.hasInt256() && VT == MVT::v8i16) {
- MVT ExtVT = MVT::v8i32;
+ if ((Subtarget.hasInt256() && VT == MVT::v8i16) ||
+ (Subtarget.hasAVX512() && VT == MVT::v16i16)) {
+ MVT ExtVT = MVT::getVectorVT(MVT::i32, VT.getVectorNumElements());
unsigned ExtOpc =
Op.getOpcode() == ISD::SRA ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND;
R = DAG.getNode(ExtOpc, dl, ExtVT, R);
OpenPOWER on IntegriCloud