[llvm] AMDGPU: Delete redundant recursive copy handling code (PR #157032)

Brox Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 11:19:47 PST 2025


================
@@ -48,7 +48,9 @@ body:             |
     ; CHECK-LABEL: name: sgpr_lo16
     ; CHECK: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
     ; CHECK-NEXT: [[DEF1:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
-    ; CHECK-NEXT: [[V_ALIGNBIT_B32_t16_e64_:%[0-9]+]]:vgpr_32 = V_ALIGNBIT_B32_t16_e64 0, [[DEF]], 0, killed [[DEF1]], 0, 30, 0, 0, implicit $exec
+    ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 30
+    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_16 = COPY [[S_MOV_B32_]]
+    ; CHECK-NEXT: [[V_ALIGNBIT_B32_t16_e64_:%[0-9]+]]:vgpr_32 = V_ALIGNBIT_B32_t16_e64 0, [[DEF]], 0, killed [[DEF1]], 0, killed [[COPY]], 0, 0, implicit $exec
----------------
broxigarchen wrote:

I am not sure about this patch. First of all we should not have isel emits any kind of register mistmatch between vgpr32 and vgpr16. That should consider a fault in the isel, and the other patch already fix this bfi issue.

Apart from that, we do have some ugly problem with vgpr16 and sreg32. I think previously we do want to allow folding between vgpr16 and sreg32, since the t16 version machine inst take both vgpr16 and sreg32. And this patch seems stop this folding. Do we actually want to remove it?

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


More information about the llvm-commits mailing list