Skip to content

Commit

Permalink
[AMDGPU] Add VOPD combine dependency tests. NFC. (llvm#104841)
Browse files Browse the repository at this point in the history
  • Loading branch information
rampitec authored Aug 19, 2024
1 parent 31cc4cc commit 5fcd059
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions llvm/test/CodeGen/AMDGPU/vopd-combine.mir
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
...

---
Expand Down Expand Up @@ -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
...

0 comments on commit 5fcd059

Please sign in to comment.