mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-20 19:04:10 -04:00
[DAGCombiner] Remove some dead code from ConstantFoldBITCASTofBUILD_VECTOR
This code handled SCALAR_TO_VECTOR being returned by the recursion, but the code that used to return SCALAR_TO_VECTOR was removed in 2015. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10109,15 +10109,6 @@ ConstantFoldBITCASTofBUILD_VECTOR(SDNode *BV, EVT DstEltVT) {
|
||||
// If this is a conversion of N elements of one type to N elements of another
|
||||
// type, convert each element. This handles FP<->INT cases.
|
||||
if (SrcBitSize == DstBitSize) {
|
||||
EVT VT = EVT::getVectorVT(*DAG.getContext(), DstEltVT,
|
||||
BV->getValueType(0).getVectorNumElements());
|
||||
|
||||
// Due to the FP element handling below calling this routine recursively,
|
||||
// we can end up with a scalar-to-vector node here.
|
||||
if (BV->getOpcode() == ISD::SCALAR_TO_VECTOR)
|
||||
return DAG.getNode(ISD::SCALAR_TO_VECTOR, SDLoc(BV), VT,
|
||||
DAG.getBitcast(DstEltVT, BV->getOperand(0)));
|
||||
|
||||
SmallVector<SDValue, 8> Ops;
|
||||
for (SDValue Op : BV->op_values()) {
|
||||
// If the vector element type is not legal, the BUILD_VECTOR operands
|
||||
@@ -10127,6 +10118,8 @@ ConstantFoldBITCASTofBUILD_VECTOR(SDNode *BV, EVT DstEltVT) {
|
||||
Ops.push_back(DAG.getBitcast(DstEltVT, Op));
|
||||
AddToWorklist(Ops.back().getNode());
|
||||
}
|
||||
EVT VT = EVT::getVectorVT(*DAG.getContext(), DstEltVT,
|
||||
BV->getValueType(0).getVectorNumElements());
|
||||
return DAG.getBuildVector(VT, SDLoc(BV), Ops);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user