Skip to content

Commit 840ec59

Browse files
committed
[RISCV] Refactor setOperationActions for scalar ISD::ABS. NFC
1 parent 983869a commit 840ec59

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,11 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
419419

420420
if (Subtarget.hasVendorXCValu() && !Subtarget.is64Bit()) {
421421
setOperationAction(ISD::ABS, XLenVT, Legal);
422-
} else {
423-
if (!RV64LegalI32 && Subtarget.is64Bit() &&
424-
!Subtarget.hasShortForwardBranchOpt())
425-
setOperationAction(ISD::ABS, MVT::i32, Custom);
426-
422+
} else if (Subtarget.hasShortForwardBranchOpt()) {
427423
// We can use PseudoCCSUB to implement ABS.
428-
if (Subtarget.hasShortForwardBranchOpt())
429-
setOperationAction(ISD::ABS, XLenVT, Legal);
424+
setOperationAction(ISD::ABS, XLenVT, Legal);
425+
} else if (!RV64LegalI32 && Subtarget.is64Bit()) {
426+
setOperationAction(ISD::ABS, MVT::i32, Custom);
430427
}
431428

432429
if (!Subtarget.hasVendorXTHeadCondMov()) {

0 commit comments

Comments
 (0)