Skip to content

Commit

Permalink
[X86] Don't limit splitVector helper to simple types.
Browse files Browse the repository at this point in the history
It can handle EVT just as well (and so can the extractSubVector calls).
  • Loading branch information
RKSimon committed May 3, 2020
1 parent 4f576ea commit e8d9794
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Expand Up @@ -5751,13 +5751,14 @@ static bool collectConcatOps(SDNode *N, SmallVectorImpl<SDValue> &Ops) {

static std::pair<SDValue, SDValue> splitVector(SDValue Op, SelectionDAG &DAG,
const SDLoc &dl) {
MVT VT = Op.getSimpleValueType();
EVT VT = Op.getValueType();
unsigned NumElems = VT.getVectorNumElements();
unsigned SizeInBits = VT.getSizeInBits();
assert((NumElems % 2) == 0 && (SizeInBits % 2) == 0 &&
"Can't split odd sized vector");

SDValue Lo = extractSubVector(Op, 0, DAG, dl, SizeInBits / 2);
SDValue Hi = extractSubVector(Op, NumElems / 2, DAG, dl, SizeInBits / 2);

return std::make_pair(Lo, Hi);
}

Expand Down

0 comments on commit e8d9794

Please sign in to comment.