mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-05 00:59:19 +00:00
[SelectionDAG] In SplitVecOp_EXTRACT_VECTOR_ELT, simplify the code that makes the type byte addressable.
We can just extend the original vector to vXi1 and trust that the legalization process will revisit it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
608221f7aa
commit
ff096475db
@ -1749,20 +1749,11 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
// Make the vector elements byte-addressable if they aren't already.
|
||||
SDLoc dl(N);
|
||||
EVT EltVT = VecVT.getVectorElementType();
|
||||
if (EltVT.getSizeInBits() < 8) {
|
||||
SmallVector<SDValue, 4> ElementOps;
|
||||
for (unsigned i = 0; i < VecVT.getVectorNumElements(); ++i) {
|
||||
ElementOps.push_back(DAG.getAnyExtOrTrunc(
|
||||
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, Vec,
|
||||
DAG.getConstant(i, dl,
|
||||
TLI.getVectorIdxTy(DAG.getDataLayout()))),
|
||||
dl, MVT::i8));
|
||||
}
|
||||
|
||||
if (VecVT.getScalarSizeInBits() < 8) {
|
||||
EltVT = MVT::i8;
|
||||
VecVT = EVT::getVectorVT(*DAG.getContext(), EltVT,
|
||||
VecVT.getVectorNumElements());
|
||||
Vec = DAG.getBuildVector(VecVT, dl, ElementOps);
|
||||
Vec = DAG.getNode(ISD::ANY_EXTEND, dl, VecVT, Vec);
|
||||
}
|
||||
|
||||
// Store the vector to the stack.
|
||||
|
Loading…
x
Reference in New Issue
Block a user