[llvm] [RISCV][GISel] Instruction selection for G_JUMP_TABLE and G_BRJT. (PR #71987)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 09:58:02 PST 2023


================
@@ -493,6 +498,50 @@ bool RISCVInstructionSelector::select(MachineInstr &MI) {
     MI.eraseFromParent();
     return constrainSelectedInstRegOperands(*Bcc, TII, TRI, RBI);
   }
+  case TargetOpcode::G_BRJT: {
+    // FIXME: Move to legalization?
+    unsigned EntrySize =
+        MF.getJumpTableInfo()->getEntrySize(MF.getDataLayout());
+    assert((EntrySize == 4 || (Subtarget->is64Bit() && EntrySize == 8)) &&
----------------
topperc wrote:

PointerSize would be 4 for RV32 and 8 for RV64 so those are handled. RISC-V doesn't use EK_Inline as far as I know.

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


More information about the llvm-commits mailing list