[llvm] [AMDGPU] Add VOPD combine dependency tests. NFC. (PR #104841)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 12:52:15 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/104841.diff


1 Files Affected:

- (modified) llvm/test/CodeGen/AMDGPU/vopd-combine.mir (+49) 


``````````diff
diff --git a/llvm/test/CodeGen/AMDGPU/vopd-combine.mir b/llvm/test/CodeGen/AMDGPU/vopd-combine.mir
index b8ac50c3aeb5e..8d5060177c63d 100644
--- a/llvm/test/CodeGen/AMDGPU/vopd-combine.mir
+++ b/llvm/test/CodeGen/AMDGPU/vopd-combine.mir
@@ -23,6 +23,8 @@
   define void @vopd_mov_fixup_fail() { ret void }
   define void @vopd_no_combine_dependent_subreg() { ret void }
   define void @vopd_mov_mov_same_src_bank() { ret void }
+  define void @vopd_combine_opy_overwrites_opx() { ret void }
+  define void @vopd_no_combine_opx_overwrites_opy() { ret void }
 ...
 
 ---
@@ -737,3 +739,50 @@ body:             |
     $vgpr2 = V_MOV_B32_e32 $vgpr1, implicit $exec
     $vgpr3 = V_MOV_B32_e32 $vgpr5, implicit $exec
 ...
+
+---
+# There is no race between mov and add, they are executed at the same time
+name:            vopd_combine_opy_overwrites_opx
+tracksRegLiveness: true
+body:             |
+  bb.0:
+    ; SCHED-LABEL: name: vopd_combine_opy_overwrites_opx
+    ; SCHED: $vgpr1 = IMPLICIT_DEF
+    ; SCHED-NEXT: $vgpr3 = IMPLICIT_DEF
+    ; SCHED-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
+    ; SCHED-NEXT: $vgpr1 = V_ADD_F32_e32 killed $vgpr3, $vgpr3, implicit $mode, implicit $exec
+    ;
+    ; PAIR-GFX11-LABEL: name: vopd_combine_opy_overwrites_opx
+    ; PAIR-GFX11: $vgpr1 = IMPLICIT_DEF
+    ; PAIR-GFX11-NEXT: $vgpr3 = IMPLICIT_DEF
+    ; PAIR-GFX11-NEXT: $vgpr0, $vgpr1 = V_DUAL_MOV_B32_e32_X_ADD_F32_e32_gfx11 killed $vgpr1, killed $vgpr3, $vgpr3, implicit $exec, implicit $mode, implicit $exec, implicit $mode, implicit $exec
+    ;
+    ; PAIR-GFX12-LABEL: name: vopd_combine_opy_overwrites_opx
+    ; PAIR-GFX12: $vgpr1 = IMPLICIT_DEF
+    ; PAIR-GFX12-NEXT: $vgpr3 = IMPLICIT_DEF
+    ; PAIR-GFX12-NEXT: $vgpr0, $vgpr1 = V_DUAL_MOV_B32_e32_X_ADD_F32_e32_gfx12 killed $vgpr1, killed $vgpr3, $vgpr3, implicit $exec, implicit $mode, implicit $exec, implicit $mode, implicit $exec
+    $vgpr1 = IMPLICIT_DEF
+    $vgpr3 = IMPLICIT_DEF
+    $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
+    $vgpr1 = V_ADD_F32_e32 $vgpr3, $vgpr3, implicit $mode, implicit $exec
+...
+
+---
+# OPY cannot cosume value produced by OPX
+name:            vopd_no_combine_opx_overwrites_opy
+tracksRegLiveness: true
+body:             |
+  bb.0:
+    ; SCHED-LABEL: name: vopd_no_combine_opx_overwrites_opy
+    ; SCHED: $vgpr1 = IMPLICIT_DEF
+    ; SCHED-NEXT: $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
+    ; SCHED-NEXT: $vgpr3 = V_ADD_F32_e32 killed $vgpr0, killed $vgpr1, implicit $mode, implicit $exec
+    ;
+    ; PAIR-LABEL: name: vopd_no_combine_opx_overwrites_opy
+    ; PAIR: $vgpr1 = IMPLICIT_DEF
+    ; PAIR-NEXT: $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
+    ; PAIR-NEXT: $vgpr3 = V_ADD_F32_e32 killed $vgpr0, killed $vgpr1, implicit $mode, implicit $exec
+    $vgpr1 = IMPLICIT_DEF
+    $vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
+    $vgpr3 = V_ADD_F32_e32 $vgpr0, $vgpr1, implicit $mode, implicit $exec
+...

``````````

</details>


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


More information about the llvm-commits mailing list