Skip to content

Commit 6548414

Browse files
committed
This appears optimal
1 parent ef92ded commit 6548414

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,9 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
974974
Custom);
975975
}
976976

977-
setTargetDAGCombine({ISD::ADD,
977+
setTargetDAGCombine({
978+
ISD::ABS,
979+
ISD::ADD,
978980
ISD::PTRADD,
979981
ISD::UADDO_CARRY,
980982
ISD::SUB,
@@ -16854,6 +16856,11 @@ SDValue SITargetLowering::PerformDAGCombine(SDNode *N,
1685416856
if (getTargetMachine().getOptLevel() == CodeGenOptLevel::None)
1685516857
return SDValue();
1685616858

16859+
// expandABS but only for i8 and i16
16860+
if (N->getOpcode() == ISD::ABS && !N->isDivergent() &&
16861+
(N->getValueType(0) == MVT::i8 || N->getValueType(0) == MVT::i16))
16862+
return expandABS(N, DCI.DAG);
16863+
1685716864
switch (N->getOpcode()) {
1685816865
case ISD::ADD:
1685916866
return performAddCombine(N, DCI);

0 commit comments

Comments
 (0)