summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 2fca8e742b3..edefa158376 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -17789,15 +17789,13 @@ SDValue X86TargetLowering::LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const {
// vpmovqb/w/d, vpmovdb/w, vpmovwb
if (Subtarget.hasAVX512()) {
- // word to byte only under BWI
- if (InVT == MVT::v16i16 && !Subtarget.hasBWI()) { // v16i16 -> v16i8
- // Make sure we're allowed to promote 512-bits.
- if (Subtarget.canExtendTo512DQ())
- return DAG.getNode(ISD::TRUNCATE, DL, VT,
- DAG.getNode(X86ISD::VSEXT, DL, MVT::v16i32, In));
- } else {
+ // word to byte only under BWI. Otherwise we have to promoted to v16i32
+ // and then truncate that. But we should only do that if we haven't been
+ // asked to avoid 512-bit vectors. The actual promotion to v16i32 will be
+ // handled by isel patterns.
+ if (InVT != MVT::v16i16 || Subtarget.hasBWI() ||
+ Subtarget.canExtendTo512DQ())
return Op;
- }
}
unsigned NumPackedSignBits = std::min<unsigned>(VT.getScalarSizeInBits(), 16);
OpenPOWER on IntegriCloud