[llvm] [AMDGPU][GlobalISel] Add RegBankLegalize support for ASSERT ops (PR #161296)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 16:59:04 PDT 2025


================
@@ -617,6 +617,14 @@ RegBankLegalizeRules::RegBankLegalizeRules(const GCNSubtarget &_ST,
       .Any({{UniS64, S64}, {{Sgpr64}, {Sgpr64}}})
       .Any({{DivS64, S64}, {{Vgpr64}, {Vgpr64}, SplitTo32SExtInReg}});
 
+  addRulesForGOpcs({G_ASSERT_ZEXT, G_ASSERT_SEXT}, Standard)
+      .Uni(S32, {{Sgpr32}, {Sgpr32, Imm}})
+      .Div(S32, {{Vgpr32}, {Vgpr32, Imm}});
+
+  addRulesForGOpcs({G_ASSERT_ALIGN})
+      .Any({{UniP1}, {{SgprP1}, {SgprP1}}})
+      .Any({{DivP1}, {{VgprP1}, {VgprP1}}});
----------------
arsenm wrote:

This needs to support all pointer types, not just the common 64-bit cases 

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


More information about the llvm-commits mailing list