diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-04-25 09:34:36 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-04-25 09:34:36 +0000 |
commit | 0a7d1b3ce1d2ff51e49c260d022bb99bfb4e1dc7 (patch) | |
tree | aa9537a5b579d72484539e8680a1011b4c37c1ce /llvm/lib | |
parent | d144572dac23c3af6a1ea5efbdffd8813138e216 (diff) | |
download | bcm5719-llvm-0a7d1b3ce1d2ff51e49c260d022bb99bfb4e1dc7.tar.gz bcm5719-llvm-0a7d1b3ce1d2ff51e49c260d022bb99bfb4e1dc7.zip |
[X86][SSE] combineBitcastvxi1 - add support for bitcasting to non-scalar integers
Truncate the movmsk scalar integer result to the equivalent scalar integer width as before but then bitcast to the requested type.
We still have the issue identified in PR41594 but D61114 should handle this.
llvm-svn: 359176
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index f7c91ba0e65..5a63d00b405 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -33735,8 +33735,7 @@ static SDValue combineBitcastvxi1(SelectionDAG &DAG, EVT VT, SDValue Src, const SDLoc &DL, const X86Subtarget &Subtarget) { EVT SrcVT = Src.getValueType(); - - if (!VT.isScalarInteger() || !SrcVT.isSimple()) + if (!SrcVT.isSimple() || SrcVT.getScalarType() != MVT::i1) return SDValue(); // If the input is a truncate from v16i8 or v32i8 go ahead and use a @@ -33832,7 +33831,11 @@ static SDValue combineBitcastvxi1(SelectionDAG &DAG, EVT VT, SDValue Src, DAG.getUNDEF(MVT::v8i16)); V = DAG.getNode(X86ISD::MOVMSK, DL, MVT::i32, V); } - return DAG.getZExtOrTrunc(V, DL, VT); + + EVT IntVT = + EVT::getIntegerVT(*DAG.getContext(), SrcVT.getVectorNumElements()); + V = DAG.getZExtOrTrunc(V, DL, IntVT); + return DAG.getBitcast(VT, V); } // Convert a vXi1 constant build vector to the same width scalar integer. |