Skip to content

Commit f899893

Browse files
authored
[AMDGPU][NFC] Cleanly make 32-bit abs legal (#164837)
Cleanly make 32-bit abs legal only in SIISelLowering.cpp Signed-off-by: John Lu <[email protected]>
1 parent 1c30038 commit f899893

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(const TargetMachine &TM,
514514
MVT::i64, Custom);
515515
setOperationAction(ISD::SELECT_CC, MVT::i64, Expand);
516516

517-
setOperationAction({ISD::ABS, ISD::SMIN, ISD::UMIN, ISD::SMAX, ISD::UMAX},
518-
MVT::i32, Legal);
517+
setOperationAction({ISD::SMIN, ISD::UMIN, ISD::SMAX, ISD::UMAX}, MVT::i32,
518+
Legal);
519519

520520
setOperationAction(
521521
{ISD::CTTZ, ISD::CTTZ_ZERO_UNDEF, ISD::CTLZ, ISD::CTLZ_ZERO_UNDEF},

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ R600TargetLowering::R600TargetLowering(const TargetMachine &TM,
4545
// Legalize loads and stores to the private address space.
4646
setOperationAction(ISD::LOAD, {MVT::i32, MVT::v2i32, MVT::v4i32}, Custom);
4747

48-
// 32-bit ABS is legal for AMDGPU except for R600
49-
setOperationAction(ISD::ABS, MVT::i32, Expand);
50-
5148
// EXTLOAD should be the same as ZEXTLOAD. It is legal for some address
5249
// spaces, so it is custom lowered to handle those where it isn't.
5350
for (auto Op : {ISD::SEXTLOAD, ISD::ZEXTLOAD, ISD::EXTLOAD})

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
298298
setOperationAction(ISD::BR_CC,
299299
{MVT::i1, MVT::i32, MVT::i64, MVT::f32, MVT::f64}, Expand);
300300

301-
setOperationAction({ISD::UADDO, ISD::USUBO}, MVT::i32, Legal);
301+
setOperationAction({ISD::ABS, ISD::UADDO, ISD::USUBO}, MVT::i32, Legal);
302302

303303
setOperationAction({ISD::UADDO_CARRY, ISD::USUBO_CARRY}, MVT::i32, Legal);
304304

0 commit comments

Comments
 (0)