[llvm] [RISCV][GISel] Legalizer and register bank selection for G_JUMP_TABLE and G_BRJT (PR #71970)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 12:21:50 PST 2023


================
@@ -131,13 +131,14 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
 
   getActionDefinitionsBuilder(G_BRCOND).legalFor({sXLen}).minScalar(0, sXLen);
 
+  getActionDefinitionsBuilder(G_BRJT).legalFor({{p0, sXLen}});
----------------
michaelmaitland wrote:

I wanted to respond to your comment from https://github.com/llvm/llvm-project/pull/71951
 
> Does the s32 case ever occur? IRTranslator::emitJumpTableHeader seems to use the integer size of the pointer to create the type for that operand.

It would be fine to only support sXLen, although it definitely would be legal if we used s32 since it'll always generate a valid offset. I am okay to omit s32 as a legal type here to simplify. I don't have a strong opinion so you can decide.

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


More information about the llvm-commits mailing list