Skip to content

Commit 15b561e

Browse files
committed
[DAG] Move STEP_VECTOR constant fold from getNode to FoldConstantArithmetic
1 parent 1d47d5d commit 15b561e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5529,11 +5529,6 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
55295529
if (VT == MVT::f128 && C->getValueType(0) == MVT::i128)
55305530
return getConstantFP(APFloat(APFloat::IEEEquad(), Val), DL, VT);
55315531
break;
5532-
case ISD::STEP_VECTOR: {
5533-
if (SDValue V = FoldSTEP_VECTOR(DL, VT, N1, *this))
5534-
return V;
5535-
break;
5536-
}
55375532
}
55385533
}
55395534

@@ -5585,7 +5580,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
55855580
case ISD::CTLZ_ZERO_UNDEF:
55865581
case ISD::CTTZ:
55875582
case ISD::CTTZ_ZERO_UNDEF:
5588-
case ISD::CTPOP: {
5583+
case ISD::CTPOP:
5584+
case ISD::STEP_VECTOR: {
55895585
SDValue Ops = {N1};
55905586
if (SDValue Fold = FoldConstantArithmetic(Opcode, DL, VT, Ops))
55915587
return Fold;
@@ -6103,6 +6099,10 @@ SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
61036099
APFloat::rmNearestTiesToEven, &Ignored);
61046100
return getConstantFP(FPV, DL, VT);
61056101
}
6102+
case ISD::STEP_VECTOR:
6103+
if (SDValue V = FoldSTEP_VECTOR(DL, VT, N1, *this))
6104+
return V;
6105+
break;
61066106
}
61076107
}
61086108

0 commit comments

Comments
 (0)