[llvm] [AMDGPU] Fix wrong reverse operations for `v_cmpx_le_u32` (PR #146398)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 00:13:31 PDT 2025


================
@@ -10,3 +10,16 @@ body:             |
     ; GCN: S_CMP_LT_I32 65, 1, implicit-def $scc
     S_CMP_GT_I32 1, 65, implicit-def $scc
 ...
+
+---
+name:             shrink_icmp
+body:             |
+  bb.0:
+    ; GCN-LABEL: name: shrink_icmp
+    ; GCN: %op0:sgpr_32 = COPY $sgpr0
+    ; GCN-NEXT: %cond:sreg_64 = V_CMP_GE_U32_e64 5, %op0, implicit $exec
+    ; GCN-NEXT: S_NOP 0
+    %op0:sgpr_32 = COPY $sgpr0
+    %cond:sreg_64 = V_CMP_LE_U32_e64 %op0, 5, implicit $exec
----------------
jayfoad wrote:

This is not testing V_CMPX_LE_U32. Can you come up with a test that fails without your fix?

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


More information about the llvm-commits mailing list