summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-12-31 09:50:38 +0000
committerCraig Topper <craig.topper@intel.com>2017-12-31 09:50:38 +0000
commitf0f6eefb49f3f779def8201ac0cddfc05561d740 (patch)
tree56ec6167fa5eb34420d4f28b91b0f007f0e1c0c4 /llvm/lib/Target/X86
parent7f396235333ad1b0b4644a62cfad59d7ee101dfc (diff)
downloadbcm5719-llvm-f0f6eefb49f3f779def8201ac0cddfc05561d740.tar.gz
bcm5719-llvm-f0f6eefb49f3f779def8201ac0cddfc05561d740.zip
[X86] Add a DAG combine to widen (i4 (bitcast (v4i1))) before type legalization sees the i4 and changes to load/store.
Same for v2i1 and i2. llvm-svn: 321602
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f99bafde2d6..33327ca6b79 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -30426,6 +30426,18 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG,
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VT, N0,
DAG.getIntPtrConstant(0, dl));
}
+
+ // If this is a bitcast between a MVT::v4i1/v2i1 and an illegal integer
+ // type, widen both sides to avoid a trip through memory.
+ if ((SrcVT == MVT::v4i1 || SrcVT == MVT::v2i1) && VT.isScalarInteger() &&
+ Subtarget.hasVLX()) {
+ SDLoc dl(N);
+ N0 = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, MVT::v8i1,
+ DAG.getUNDEF(MVT::v8i1), N0,
+ DAG.getIntPtrConstant(0, dl));
+ N0 = DAG.getBitcast(MVT::i8, N0);
+ return DAG.getNode(ISD::TRUNCATE, dl, VT, N0);
+ }
}
// Since MMX types are special and don't usually play with other vector types,
OpenPOWER on IntegriCloud