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

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 07:44:06 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)) &&
----------------
michaelmaitland wrote:

Why do we limit EntrySize? How come we do not handle PointerSize entry or Inline entry?

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


More information about the llvm-commits mailing list