[llvm] [RISCV][GISEL] Legalize G_JUMP_TABLE and G_BRJT (PR #71951)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 08:47:29 PST 2023


================
@@ -252,6 +252,12 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
   getActionDefinitionsBuilder({G_FCEIL, G_FFLOOR})
       .libcallFor({s32, s64});
 
+  getActionDefinitionsBuilder(G_JUMP_TABLE).legalFor({p0});
+
+  getActionDefinitionsBuilder(G_BRJT).legalIf([=](const LegalityQuery &Query) {
+    return typeIs(0, p0) && typeInSet(1, {s32, sXLen});
+  });
+
----------------
topperc wrote:

Does the s32 case ever occur? IRTranslator::emitJumpTableHeader seems to use the integer size of the pointer to create the type for that operand.

https://github.com/llvm/llvm-project/pull/71951


More information about the llvm-commits mailing list