[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:40:58 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:
As written this statment is always, you have to pass Query to typeIs and typeInSet. Other wise it's just checking if the address of the typeIs and typeInSet functions are non-null. Which of course they are.
https://github.com/llvm/llvm-project/pull/71951
    
    
More information about the llvm-commits
mailing list