Skip to content

Commit 9908933

Browse files
Remove unnecessary functions for getting PR operation action
1 parent 793115a commit 9908933

File tree

4 files changed

+5
-44
lines changed

4 files changed

+5
-44
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,25 +1639,6 @@ class TargetLoweringBase {
16391639
getCondCodeAction(CC, VT) == Custom;
16401640
}
16411641

1642-
/// Return how a PARTIAL_REDUCE_U/SMLA node with Acc type AccVT and Input type
1643-
/// InputVT should be treated. Either it's legal, needs to be promoted to a
1644-
/// larger size, needs to be expanded to some other code sequence, or the
1645-
/// target has a custom expander for it.
1646-
LegalizeAction getPartialReduceMLAAction(EVT AccVT, EVT InputVT) const {
1647-
unsigned AccI = (unsigned)AccVT.getSimpleVT().SimpleTy;
1648-
unsigned InputI = (unsigned)InputVT.getSimpleVT().SimpleTy;
1649-
assert(AccI < MVT::VALUETYPE_SIZE && InputI < MVT::VALUETYPE_SIZE &&
1650-
"Table isn't big enough!");
1651-
return PartialReduceMLAActions[AccI][InputI];
1652-
}
1653-
1654-
/// Return true if a PARTIAL_REDUCE_U/SMLA node with the specified types is
1655-
/// legal or custom for this target.
1656-
bool isPartialReduceMLALegalOrCustom(EVT AccVT, EVT InputVT) const {
1657-
return getPartialReduceMLAAction(AccVT, InputVT) == Legal ||
1658-
getPartialReduceMLAAction(AccVT, InputVT) == Custom;
1659-
}
1660-
16611642
/// If the action for this operation is to promote, this method returns the
16621643
/// ValueType to promote to.
16631644
MVT getTypeToPromoteTo(unsigned Op, MVT VT) const {
@@ -2723,16 +2704,6 @@ class TargetLoweringBase {
27232704
setCondCodeAction(CCs, VT, Action);
27242705
}
27252706

2726-
/// Indicate how a PARTIAL_REDUCE_U/SMLA node with Acc type AccVT and Input
2727-
/// type InputVT should be treated by the target. Either it's legal, needs to
2728-
/// be promoted to a larger size, needs to be expanded to some other code
2729-
/// sequence, or the target has a custom expander for it.
2730-
void setPartialReduceMLAAction(MVT AccVT, MVT InputVT,
2731-
LegalizeAction Action) {
2732-
assert(AccVT.isValid() && InputVT.isValid() && "Table isn't big enough!");
2733-
PartialReduceMLAActions[AccVT.SimpleTy][InputVT.SimpleTy] = Action;
2734-
}
2735-
27362707
/// If Opc/OrigVT is specified as being promoted, the promotion code defaults
27372708
/// to trying a larger integer/fp until it can find one that works. If that
27382709
/// default is insufficient, this method can be used by the target to override
@@ -3679,12 +3650,6 @@ class TargetLoweringBase {
36793650
/// up the MVT::VALUETYPE_SIZE value to the next multiple of 8.
36803651
uint32_t CondCodeActions[ISD::SETCC_INVALID][(MVT::VALUETYPE_SIZE + 7) / 8];
36813652

3682-
/// For each result type and input type for the ISD::PARTIAL_REDUCE_U/SMLA
3683-
/// nodes, keep a LegalizeAction which indicates how instruction selection
3684-
/// should deal with this operation.
3685-
LegalizeAction PartialReduceMLAActions[MVT::VALUETYPE_SIZE]
3686-
[MVT::VALUETYPE_SIZE];
3687-
36883653
ValueTypeActionImpl ValueTypeActions;
36893654

36903655
private:

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,6 @@ namespace {
622622
SDValue CombineConsecutiveLoads(SDNode *N, EVT VT);
623623
SDValue foldBitcastedFPLogic(SDNode *N, SelectionDAG &DAG,
624624
const TargetLowering &TLI);
625-
SDValue foldMulPARTIAL_REDUCE_MLA(SDNode *N);
626-
SDValue foldExtendPARTIAL_REDUCE_MLA(SDNode *N);
627625

628626
SDValue CombineExtLoad(SDNode *N);
629627
SDValue CombineZExtLogicopShiftLoad(SDNode *N);

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
469469
case ISD::VECTOR_COMPRESS:
470470
case ISD::SCMP:
471471
case ISD::UCMP:
472+
case ISD::PARTIAL_REDUCE_UMLA:
473+
case ISD::PARTIAL_REDUCE_SMLA:
472474
Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0));
473475
break;
474476
case ISD::SMULFIX:
@@ -522,11 +524,6 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
522524
Action = TLI.getOperationAction(Node->getOpcode(), OpVT);
523525
break;
524526
}
525-
case ISD::PARTIAL_REDUCE_UMLA:
526-
case ISD::PARTIAL_REDUCE_SMLA:
527-
Action = TLI.getPartialReduceMLAAction(Node->getValueType(0),
528-
Node->getOperand(1).getValueType());
529-
break;
530527

531528
#define BEGIN_REGISTER_VP_SDNODE(VPID, LEGALPOS, ...) \
532529
case ISD::VPID: { \

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,8 +836,9 @@ void TargetLoweringBase::initActions() {
836836
setOperationAction(ISD::SET_FPENV, VT, Expand);
837837
setOperationAction(ISD::RESET_FPENV, VT, Expand);
838838

839-
for (MVT InputVT : MVT::all_valuetypes())
840-
setPartialReduceMLAAction(VT, InputVT, Expand);
839+
// PartialReduceMLA operations default to expand.
840+
setOperationAction({ISD::PARTIAL_REDUCE_UMLA, ISD::PARTIAL_REDUCE_SMLA}, VT,
841+
Expand);
841842
}
842843

843844
// Most targets ignore the @llvm.prefetch intrinsic.

0 commit comments

Comments
 (0)