@@ -725,7 +725,7 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
725725 // We have some custom DAG combine patterns for these nodes
726726 setTargetDAGCombine ({ISD::ADD, ISD::AND, ISD::EXTRACT_VECTOR_ELT, ISD::FADD,
727727 ISD::LOAD, ISD::MUL, ISD::SHL, ISD::SREM, ISD::UREM,
728- ISD::TRUNCATE, ISD:: VSELECT});
728+ ISD::VSELECT});
729729
730730 // setcc for f16x2 and bf16x2 needs special handling to prevent
731731 // legalizer's attempt to scalarize it due to v2i1 not being legal.
@@ -5601,53 +5601,6 @@ static SDValue PerformREMCombine(SDNode *N,
56015601 return SDValue ();
56025602}
56035603
5604- // truncate (logic_op x, y) --> logic_op (truncate x), (truncate y)
5605- // This will reduce register pressure.
5606- static SDValue PerformTruncCombine (SDNode *N,
5607- TargetLowering::DAGCombinerInfo &DCI) {
5608- if (!DCI.isBeforeLegalizeOps ())
5609- return SDValue ();
5610-
5611- SDValue LogicalOp = N->getOperand (0 );
5612- switch (LogicalOp.getOpcode ()) {
5613- default :
5614- break ;
5615- case ISD::ADD:
5616- case ISD::SUB:
5617- case ISD::MUL:
5618- case ISD::AND:
5619- case ISD::OR:
5620- case ISD::XOR: {
5621- EVT VT = N->getValueType (0 );
5622- EVT LogicalVT = LogicalOp.getValueType ();
5623- if (VT != MVT::i32 || LogicalVT != MVT::i64 )
5624- break ;
5625- const TargetLowering &TLI = DCI.DAG .getTargetLoweringInfo ();
5626- if (!VT.isScalarInteger () &&
5627- !TLI.isOperationLegal (LogicalOp.getOpcode (), VT))
5628- break ;
5629- if (!all_of (LogicalOp.getNode ()->uses (), [](SDNode *U) {
5630- return U->isMachineOpcode ()
5631- ? U->getMachineOpcode () == NVPTX::CVT_u32_u64
5632- : U->getOpcode () == ISD::TRUNCATE;
5633- }))
5634- break ;
5635-
5636- SDLoc DL (N);
5637- SDValue CVTNone =
5638- DCI.DAG .getTargetConstant (NVPTX::PTXCvtMode::NONE, DL, MVT::i32 );
5639- SDNode *NarrowL = DCI.DAG .getMachineNode (NVPTX::CVT_u32_u64, DL, VT,
5640- LogicalOp.getOperand (0 ), CVTNone);
5641- SDNode *NarrowR = DCI.DAG .getMachineNode (NVPTX::CVT_u32_u64, DL, VT,
5642- LogicalOp.getOperand (1 ), CVTNone);
5643- return DCI.DAG .getNode (LogicalOp.getOpcode (), DL, VT, SDValue (NarrowL, 0 ),
5644- SDValue (NarrowR, 0 ));
5645- }
5646- }
5647-
5648- return SDValue ();
5649- }
5650-
56515604enum OperandSignedness {
56525605 Signed = 0 ,
56535606 Unsigned,
@@ -6064,8 +6017,6 @@ SDValue NVPTXTargetLowering::PerformDAGCombine(SDNode *N,
60646017 case ISD::UREM:
60656018 case ISD::SREM:
60666019 return PerformREMCombine (N, DCI, OptLevel);
6067- case ISD::TRUNCATE:
6068- return PerformTruncCombine (N, DCI);
60696020 case ISD::SETCC:
60706021 return PerformSETCCCombine (N, DCI, STI.getSmVersion ());
60716022 case ISD::LOAD:
@@ -6084,9 +6035,6 @@ SDValue NVPTXTargetLowering::PerformDAGCombine(SDNode *N,
60846035 return PerformVSELECTCombine (N, DCI);
60856036 }
60866037
6087- if (N->isMachineOpcode () && N->getMachineOpcode () == NVPTX::CVT_u32_u64)
6088- return PerformTruncCombine (N, DCI);
6089-
60906038 return SDValue ();
60916039}
60926040
0 commit comments