[llvm] [RISCV][GISEL] legalize, regbankselect, and instruction-select for G_… (PR #73061)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 17:44:13 PST 2023
================
@@ -86,6 +86,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
unsigned BigTyIdx = Op == G_MERGE_VALUES ? 0 : 1;
unsigned LitTyIdx = Op == G_MERGE_VALUES ? 1 : 0;
getActionDefinitionsBuilder(Op)
+ .legalIf([=, &ST](const LegalityQuery &Query) -> bool {
+ return ST.hasStdExtD() && typeIs(LitTyIdx, s32)(Query) &&
----------------
arsenm wrote:
I'd suggest moving the subtarget check out of the predicate callback, and conditionally adding a standard type check to the action builder
https://github.com/llvm/llvm-project/pull/73061
More information about the llvm-commits
mailing list