[llvm] [AMDGPU] Add regbankselect rules for G_ADD/SUB and variants (PR #159860)

Petar Avramovic via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 08:28:15 PDT 2025


================
@@ -77,10 +77,12 @@ body: |
     ; CHECK-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
     ; CHECK-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[AND]](s32), [[C1]], [[C2]]
     ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[SELECT]](s32)
+    ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s16)
     %0:_(s32) = COPY $sgpr0
     %1:_(s32) = COPY $sgpr1
     %2:_(s1) = G_ICMP intpred(eq), %0, %1
     %3:_(s16) = G_SEXT %2
+    S_ENDPGM 0, implicit %3
----------------
petar-avramovic wrote:

Need use that is processed by regbankselect, this does not correspond to any ll test. For example store is proper use or maybe G_AND for sgpr

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


More information about the llvm-commits mailing list