[llvm] ae485e6 - [RISCV][GISel] Use customFor instead of customIf by pulling out a subtarget check. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 11:03:42 PST 2023
Author: Craig Topper
Date: 2023-11-30T11:03:14-08:00
New Revision: ae485e661ffce1f8fcd13d64974beee14b0e8af0
URL: https://github.com/llvm/llvm-project/commit/ae485e661ffce1f8fcd13d64974beee14b0e8af0
DIFF: https://github.com/llvm/llvm-project/commit/ae485e661ffce1f8fcd13d64974beee14b0e8af0.diff
LOG: [RISCV][GISel] Use customFor instead of customIf by pulling out a subtarget check. NFC
Added:
Modified:
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
index 609c26c8e16627d..153bac34986ec1c 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
@@ -57,11 +57,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
getActionDefinitionsBuilder({G_SADDO, G_SSUBO}).minScalar(0, sXLen).lower();
- getActionDefinitionsBuilder({G_ASHR, G_LSHR, G_SHL})
- .customIf([=, &ST](const LegalityQuery &Query) {
- return ST.is64Bit() && typeIs(0, s32)(Query) && typeIs(1, s32)(Query);
- })
- .legalFor({{s32, s32}, {s32, sXLen}, {sXLen, sXLen}})
+ auto &ShiftActions = getActionDefinitionsBuilder({G_ASHR, G_LSHR, G_SHL});
+ if (ST.is64Bit())
+ ShiftActions.customFor({{s32, s32}});
+ ShiftActions.legalFor({{s32, s32}, {s32, sXLen}, {sXLen, sXLen}})
.widenScalarToNextPow2(0)
.clampScalar(1, s32, sXLen)
.clampScalar(0, s32, sXLen)
More information about the llvm-commits
mailing list