@@ -178,10 +178,6 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
178178 addRegisterClass(MVT::v32i16, &AMDGPU::SGPR_512RegClass);
179179 addRegisterClass(MVT::v32f16, &AMDGPU::SGPR_512RegClass);
180180 addRegisterClass(MVT::v32bf16, &AMDGPU::SGPR_512RegClass);
181-
182- // We don't want the default expansion of 16-bit ABS since we can
183- // sign-extend and use the 32-bit ABS operation for 16-bit ABS with SGPRs
184- setOperationAction(ISD::ABS, MVT::i16, Custom);
185181 }
186182
187183 addRegisterClass(MVT::v32i32, &AMDGPU::VReg_1024RegClass);
@@ -6779,9 +6775,6 @@ SDValue SITargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
67796775 case ISD::DEBUGTRAP:
67806776 return lowerDEBUGTRAP(Op, DAG);
67816777 case ISD::ABS:
6782- if (Op.getValueType() == MVT::i16)
6783- return lowerABSi16(Op, DAG);
6784- LLVM_FALLTHROUGH;
67856778 case ISD::FABS:
67866779 case ISD::FNEG:
67876780 case ISD::FCANONICALIZE:
@@ -8147,25 +8140,6 @@ SDValue SITargetLowering::lowerDEBUGTRAP(SDValue Op, SelectionDAG &DAG) const {
81478140 return DAG.getNode(AMDGPUISD::TRAP, SL, MVT::Other, Ops);
81488141}
81498142
8150- // sign-extend and use the 32-bit ABS operation for 16-bit ABS with SGPRs
8151- SDValue SITargetLowering::lowerABSi16(SDValue Op, SelectionDAG &DAG) const {
8152- assert(Op.getOpcode() == ISD::ABS &&
8153- "Tried to select abs with non-abs opcode.");
8154- assert(Op.getValueType() == MVT::i16 &&
8155- "Tried to select abs i16 lowering with non-i16 type.");
8156-
8157- // Divergent operands will not end up using SGPRs.
8158- if (Op->isDivergent())
8159- return SDValue();
8160-
8161- //(abs i16 (i16 op1)) -> (trunc i16 (abs i32 (sext i32 (i16 op1))))
8162- SDValue Src = Op.getOperand(0);
8163- SDLoc DL(Src);
8164- SDValue SExtSrc = DAG.getSExtOrTrunc(Src, DL, MVT::i32);
8165- SDValue ExtAbs = DAG.getNode(ISD::ABS, DL, MVT::i32, SExtSrc);
8166- return DAG.getNode(ISD::TRUNCATE, DL, MVT::i16, ExtAbs);
8167- }
8168-
81698143SDValue SITargetLowering::getSegmentAperture(unsigned AS, const SDLoc &DL,
81708144 SelectionDAG &DAG) const {
81718145 if (Subtarget->hasApertureRegs()) {
0 commit comments