AMDGPU: Stop special casing constant indexes of extract_vector_elt

The same result folds out of the dynamic expansion logic if the
index is constant.

llvm-svn: 331906
This commit is contained in:
Matt Arsenault 2018-05-09 18:29:26 +00:00
parent 4e548fe06f
commit 378f86998c
1 changed files with 0 additions and 15 deletions

View File

@ -4201,21 +4201,6 @@ SDValue SITargetLowering::lowerEXTRACT_VECTOR_ELT(SDValue Op,
if (SDValue Combined = performExtractVectorEltCombine(Op.getNode(), DCI))
return Combined;
if (const ConstantSDNode *CIdx = dyn_cast<ConstantSDNode>(Idx)) {
SDValue Result = DAG.getNode(ISD::BITCAST, SL, MVT::i32, Vec);
if (CIdx->getZExtValue() == 1) {
Result = DAG.getNode(ISD::SRL, SL, MVT::i32, Result,
DAG.getConstant(16, SL, MVT::i32));
} else {
assert(CIdx->getZExtValue() == 0);
}
if (ResultVT.bitsLT(MVT::i32))
Result = DAG.getNode(ISD::TRUNCATE, SL, MVT::i16, Result);
return DAG.getNode(ISD::BITCAST, SL, ResultVT, Result);
}
SDValue Four = DAG.getConstant(4, SL, MVT::i32);
// Convert vector index to bit-index (* 16)