[LegalizeVectorTypes] Remove non-constnat INSERT_SUBVECTOR handling. NFC

Now that D79814 has landed, we can assume that subvector ops use constant, in-range indices.
This commit is contained in:
Craig Topper 2020-05-15 12:44:52 -07:00
parent e32f8e5d4a
commit 45c7b3fd91
1 changed files with 8 additions and 10 deletions

View File

@ -1143,16 +1143,14 @@ void DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo,
// boundary between the halves, we can avoid spilling the vector, and insert
// into the lower half of the split vector directly.
// TODO: The IdxVal == 0 constraint is artificial, we could do this whenever
// the index is constant and there is no boundary crossing. But those cases
// don't seem to get hit in practice.
if (ConstantSDNode *ConstIdx = dyn_cast<ConstantSDNode>(Idx)) {
unsigned IdxVal = ConstIdx->getZExtValue();
if ((IdxVal == 0) && (IdxVal + SubElems <= VecElems / 2)) {
EVT LoVT, HiVT;
std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0));
Lo = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, LoVT, Lo, SubVec, Idx);
return;
}
// there is no boundary crossing. But those cases don't seem to get hit in
// practice.
unsigned IdxVal = cast<ConstantSDNode>(Idx)->getZExtValue();
if ((IdxVal == 0) && (IdxVal + SubElems <= VecElems / 2)) {
EVT LoVT, HiVT;
std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0));
Lo = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, LoVT, Lo, SubVec, Idx);
return;
}
// Spill the vector to the stack.