Skip to content

Commit ae485e6

Browse files
committed
[RISCV][GISel] Use customFor instead of customIf by pulling out a subtarget check. NFC
1 parent 89165e8 commit ae485e6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
5757

5858
getActionDefinitionsBuilder({G_SADDO, G_SSUBO}).minScalar(0, sXLen).lower();
5959

60-
getActionDefinitionsBuilder({G_ASHR, G_LSHR, G_SHL})
61-
.customIf([=, &ST](const LegalityQuery &Query) {
62-
return ST.is64Bit() && typeIs(0, s32)(Query) && typeIs(1, s32)(Query);
63-
})
64-
.legalFor({{s32, s32}, {s32, sXLen}, {sXLen, sXLen}})
60+
auto &ShiftActions = getActionDefinitionsBuilder({G_ASHR, G_LSHR, G_SHL});
61+
if (ST.is64Bit())
62+
ShiftActions.customFor({{s32, s32}});
63+
ShiftActions.legalFor({{s32, s32}, {s32, sXLen}, {sXLen, sXLen}})
6564
.widenScalarToNextPow2(0)
6665
.clampScalar(1, s32, sXLen)
6766
.clampScalar(0, s32, sXLen)

0 commit comments

Comments
 (0)