mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
CONCAT_VECTOR of BUILD_VECTOR - minor fix
Fixed issue with the combine of CONCAT_VECTOR of 2 BUILD_VECTOR nodes - the optimisation wasn't ensuring that the scalar operands of both nodes were the same type/size for implicit truncation. Test case spotted by Patrik Hagglund git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235371 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3198,6 +3198,18 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1,
|
||||
SmallVector<SDValue, 16> Elts(N1.getNode()->op_begin(),
|
||||
N1.getNode()->op_end());
|
||||
Elts.append(N2.getNode()->op_begin(), N2.getNode()->op_end());
|
||||
|
||||
// BUILD_VECTOR requires all inputs to be of the same type, find the
|
||||
// maximum type and extend them all.
|
||||
EVT SVT = VT.getScalarType();
|
||||
for (SDValue Op : Elts)
|
||||
SVT = (SVT.bitsLT(Op.getValueType()) ? Op.getValueType() : SVT);
|
||||
if (SVT.bitsGT(VT.getScalarType()))
|
||||
for (SDValue &Op : Elts)
|
||||
Op = TLI->isZExtFree(Op.getValueType(), SVT)
|
||||
? getZExtOrTrunc(Op, DL, SVT)
|
||||
: getSExtOrTrunc(Op, DL, SVT);
|
||||
|
||||
return getNode(ISD::BUILD_VECTOR, DL, VT, Elts);
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user