mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Revert r226811, MSVC accepts code sane compilers don't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226814 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1513,10 +1513,9 @@ SDValue SelectionDAG::getVectorShuffle(EVT VT, SDLoc dl, SDValue N1,
|
||||
return getUNDEF(VT);
|
||||
|
||||
// If Identity shuffle return that node.
|
||||
bool Identity = true, AllSame = true;
|
||||
bool Identity = true;
|
||||
for (unsigned i = 0; i != NElts; ++i) {
|
||||
if (MaskVec[i] >= 0 && MaskVec[i] != (int)i) Identity = false;
|
||||
if (MaskVec[i] != MaskVec[0]) AllSame = false;
|
||||
}
|
||||
if (Identity && NElts)
|
||||
return N1;
|
||||
@@ -1550,26 +1549,6 @@ SDValue SelectionDAG::getVectorShuffle(EVT VT, SDLoc dl, SDValue N1,
|
||||
if (C->isNullValue())
|
||||
return N1;
|
||||
}
|
||||
|
||||
// If the shuffle itself creates a constant splat, build the vector
|
||||
// directly.
|
||||
if (AllSame) {
|
||||
const SDValue &Splatted = BV->getOperand(MaskVec[0]);
|
||||
if (isa<ConstantSDNode>(Splatted) || isa<ConstantFPSDNode>(Splatted)) {
|
||||
SmallVector<SDValue, 8> Ops;
|
||||
for (unsigned i = 0; i != NElts; ++i) {
|
||||
Ops.push_back(Splatted);
|
||||
}
|
||||
SDValue &NewBV = getNode(ISD::BUILD_VECTOR, dl,
|
||||
BV->getValueType(0), Ops);
|
||||
|
||||
// We may have jumped through bitcasts, so the type of the
|
||||
// BUILD_VECTOR may not match the type of the shuffle.
|
||||
if (BV->getValueType(0) != VT)
|
||||
NewBV = getNode(ISD::BITCAST, dl, VT, NewBV);
|
||||
return NewBV;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user