[llvm] 22cc497 - AMDGPU: Fix not checking liveness in test
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 07:00:30 PDT 2022
Author: Matt Arsenault
Date: 2022-06-07T10:00:25-04:00
New Revision: 22cc497502f2780f84a01aee389d59ae0fa0e687
URL: https://github.com/llvm/llvm-project/commit/22cc497502f2780f84a01aee389d59ae0fa0e687
DIFF: https://github.com/llvm/llvm-project/commit/22cc497502f2780f84a01aee389d59ae0fa0e687.diff
LOG: AMDGPU: Fix not checking liveness in test
Added:
Modified:
llvm/test/CodeGen/AMDGPU/v_swap_b32.mir
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AMDGPU/v_swap_b32.mir b/llvm/test/CodeGen/AMDGPU/v_swap_b32.mir
index 8c9350c0be2a9..222063316d035 100644
--- a/llvm/test/CodeGen/AMDGPU/v_swap_b32.mir
+++ b/llvm/test/CodeGen/AMDGPU/v_swap_b32.mir
@@ -1,12 +1,15 @@
-# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass si-shrink-instructions -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
+# RUN: llc -simplify-mir -march=amdgcn -mcpu=gfx900 -run-pass=si-shrink-instructions -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
# GCN-LABEL: name: swap_phys_condensed
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
# GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
# GCN-NEXT: S_SETPC_B64_return
---
name: swap_phys_condensed
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
@@ -18,6 +21,8 @@ body: |
# GCN-LABEL: name: swap_phys_sparse
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
# GCN-NEXT: $vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
# GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
@@ -25,9 +30,10 @@ body: |
# GCN-NEXT: S_SETPC_B64_return
---
name: swap_phys_sparse
+tracksRegLiveness: true
body: |
bb.0:
- liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
+ liveins: $vgpr0, $vgpr1, $vgpr4, $vgpr6, $sgpr30_sgpr31
$vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
@@ -38,45 +44,55 @@ body: |
# GCN-LABEL: name: swap_phys_liveout
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
# GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
# GCN-NEXT: S_SETPC_B64_return
---
name: swap_phys_liveout
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
$vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
$vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
- S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr2, implicit $vgpr1
+ S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
...
# GCN-LABEL: name: swap_phys_liveout_superreg
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
# GCN-NEXT: $vgpr0, $vgpr1 = V_SWAP_B32 $vgpr1, $vgpr0, implicit $exec
# GCN-NEXT: S_SETPC_B64_return
---
name: swap_phys_liveout_superreg
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
$vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
$vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
- S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr2_vgpr3, implicit $vgpr1
+ S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
...
# GCN-LABEL: name: swap_phys_b64
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr4_vgpr5 = COPY $vgpr0_vgpr1
# GCN-NEXT: $vgpr0, $vgpr2 = V_SWAP_B32 $vgpr2, $vgpr0, implicit $exec
# GCN-NEXT: $vgpr1, $vgpr3 = V_SWAP_B32 $vgpr3, $vgpr1, implicit $exec
---
name: swap_phys_b64
+tracksRegLiveness: true
body: |
bb.0:
+ liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
$vgpr4_vgpr5 = COPY killed $vgpr0_vgpr1
$vgpr0_vgpr1 = COPY killed $vgpr2_vgpr3
$vgpr2_vgpr3 = COPY killed $vgpr4_vgpr5
@@ -84,14 +100,18 @@ body: |
# GCN-LABEL: name: swap_phys_overlap_x
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
# GCN-NEXT: $vgpr3_vgpr4 = V_ADD_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr3_vgpr4, 0, 0, implicit $mode, implicit $exec
# GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
# GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
---
name: swap_phys_overlap_x
+tracksRegLiveness: true
body: |
bb.0:
+ liveins: $vgpr0_vgpr1, $vgpr3_vgpr4
$vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
$vgpr3_vgpr4 = V_ADD_F64_e64 0, $vgpr0_vgpr1, 0, $vgpr3_vgpr4, 0, 0, implicit $mode, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
@@ -100,14 +120,18 @@ body: |
# GCN-LABEL: name: swap_phys_clobber_y
# GCN: bb.0:
+# GCN-NEXT: liveins:
+# GCN-NEXT: {{^[ ]*$}}
# GCN-NEXT: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
# GCN-NEXT: $vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
# GCN-NEXT: $vgpr1 = V_MOV_B32_e32 0, implicit $exec
# GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
---
name: swap_phys_clobber_y
+tracksRegLiveness: true
body: |
bb.0:
+ liveins: $vgpr0, $vgpr1
$vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
$vgpr1 = V_MOV_B32_e32 0, implicit $exec
@@ -119,6 +143,7 @@ body: |
# GCN: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
---
name: swap_virt_copy_condense
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -136,6 +161,7 @@ body: |
# GCN: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
---
name: swap_virt_copy_sparse
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -155,6 +181,7 @@ body: |
# GCN: %0.sub0:vreg_64, %1.sub0:vreg_64 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
---
name: swap_virt_copy_subreg
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_64 }
- { id: 1, class: vreg_64 }
@@ -174,6 +201,7 @@ body: |
# GCN: %0:vgpr_32, %1:vgpr_32 = V_SWAP_B32 %1, %0, implicit $exec
---
name: swap_virt_mov
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -199,6 +227,7 @@ body: |
---
name: swap_virt_read_x
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -226,6 +255,7 @@ body: |
---
name: swap_virt_read_t_twice
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -254,6 +284,7 @@ body: |
---
name: swap_virt_clobber_y
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -281,6 +312,7 @@ body: |
---
name: swap_virt_clobber_x1
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -308,6 +340,7 @@ body: |
---
name: swap_virt_clobber_x2
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -335,6 +368,7 @@ body: |
---
name: swap_virt_clobber_t
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -360,6 +394,7 @@ body: |
# GCN-NEXT: %1.sub0:vreg_64 = COPY %2.sub0
---
name: swap_virt_copy_subreg_overlap_x_full
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_64 }
- { id: 1, class: vreg_64 }
@@ -385,6 +420,7 @@ body: |
# GCN-NEXT: %1.sub0:vreg_64 = COPY %2.sub0
---
name: swap_virt_copy_subreg_overlap_x_part
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_128 }
- { id: 1, class: vreg_64 }
@@ -409,6 +445,7 @@ body: |
# GCN-NEXT: %1:vreg_64 = COPY %2
---
name: swap_virt_copy_subreg_wide_y
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_64 }
- { id: 1, class: vreg_64 }
@@ -430,6 +467,7 @@ body: |
# GCN-NEXT: %0.sub1:vreg_64, %1.sub1:vreg_64 = V_SWAP_B32 %1.sub1, %0.sub1, implicit $exec
---
name: swap_virt_b64
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_64 }
- { id: 1, class: vreg_64 }
@@ -453,6 +491,7 @@ body: |
# GCN-NEXT: %0.sub3:vreg_128, %1.sub3:vreg_128 = V_SWAP_B32 %1.sub3, %0.sub3, implicit $exec
---
name: swap_virt_b128
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_128 }
- { id: 1, class: vreg_128 }
@@ -475,6 +514,7 @@ body: |
# GCN-NEXT: S_ENDPGM 0
---
name: swap_virt_b128_sub0_1
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_128 }
- { id: 1, class: vreg_128 }
@@ -498,6 +538,7 @@ body: |
# GCN-NEXT: S_ENDPGM 0
---
name: swap_virt_b128_sub2_3
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_128 }
- { id: 1, class: vreg_128 }
@@ -522,6 +563,7 @@ body: |
# GCN-NEXT: %1:sgpr_32 = COPY %2
---
name: swap_virt_s_to_s
+tracksRegLiveness: true
registers:
- { id: 0, class: sgpr_32 }
- { id: 1, class: sgpr_32 }
@@ -541,6 +583,7 @@ body: |
# GCN-NEXT: %0.sub0:vreg_64, %1.sub0:vreg_64 = V_SWAP_B32 %1.sub0, %0.sub0, implicit $exec
---
name: swap_virt_copy_subreg_impdef_super
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_64 }
- { id: 1, class: vreg_64 }
@@ -568,6 +611,7 @@ body: |
# GCN-NEXT: S_ENDPGM 0
---
name: swap_virt_copy_subreg_impuse_x
+tracksRegLiveness: true
registers:
- { id: 0, class: vreg_64 }
- { id: 1, class: vreg_64 }
@@ -607,6 +651,7 @@ body: |
---
name: swap_exact_max_insns_apart
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -663,6 +708,7 @@ body: |
---
name: swap_too_far
+tracksRegLiveness: true
registers:
- { id: 0, class: vgpr_32 }
- { id: 1, class: vgpr_32 }
@@ -747,9 +793,10 @@ body: |
---
name: swap_killed_t_early
+tracksRegLiveness: true
body: |
bb.0:
- liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
+ liveins: $vgpr0, $vgpr1, $vgpr4, $vgpr6, $sgpr30_sgpr31
$vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec, implicit killed $vgpr2
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
@@ -767,9 +814,10 @@ body: |
---
name: swap_killed_t_late
+tracksRegLiveness: true
body: |
bb.0:
- liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
+ liveins: $vgpr0, $vgpr1, $vgpr4, $vgpr6, $sgpr30_sgpr31
$vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
@@ -787,15 +835,16 @@ body: |
---
name: swap_killed_x
+tracksRegLiveness: true
body: |
bb.0:
- liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
+ liveins: $vgpr0, $vgpr1, $vgpr4, $vgpr6, $sgpr30_sgpr31
$vgpr2 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr3 = V_MOV_B32_e32 killed $vgpr4, implicit $exec
$vgpr0 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
$vgpr5 = V_MOV_B32_e32 killed $vgpr6, implicit $exec, implicit killed $vgpr0
$vgpr1 = V_MOV_B32_e32 killed $vgpr2, implicit $exec
- S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
+ S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr1
...
# GCN-LABEL: name: indirect_mov_t
@@ -806,6 +855,7 @@ body: |
---
name: indirect_mov_t
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
@@ -823,6 +873,7 @@ body: |
---
name: indirect_mov_x
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
@@ -840,6 +891,7 @@ body: |
---
name: indirect_mov_y
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
@@ -854,6 +906,7 @@ body: |
---
name: implicit_ops_mov_x_swap_b32
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
@@ -870,17 +923,15 @@ body: |
---
name: implict_ops_mov_x_swap_b64
-registers:
- - { id: 0, class: vreg_64 }
- - { id: 1, class: vreg_64 }
- - { id: 2, class: vreg_64 }
+tracksRegLiveness: true
body: |
bb.0:
- %0 = IMPLICIT_DEF
- %1 = IMPLICIT_DEF
- %2 = COPY %0
- %0 = COPY %1, implicit $vgpr0
- %1 = COPY %2
+ liveins: $vgpr0
+ %0:vreg_64 = IMPLICIT_DEF
+ %1:vreg_64 = IMPLICIT_DEF
+ %2:vreg_64 = COPY %0
+ %0:vreg_64 = COPY %1, implicit $vgpr0
+ %1:vreg_64 = COPY %2
...
# GCN-LABEL: implicit_ops_mov_t_swap_b32
@@ -889,6 +940,7 @@ body: |
---
name: implicit_ops_mov_t_swap_b32
+tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
@@ -904,9 +956,10 @@ body: |
---
name: implicit_ops_mov_y_swap_b32
+tracksRegLiveness: true
body: |
bb.0:
- liveins: $vgpr0, $vgpr1, $sgpr30_sgpr31
+ liveins: $vgpr0, $vgpr1, $vgpr2, $sgpr30_sgpr31
$vgpr3 = V_MOV_B32_e32 killed $vgpr0, implicit $exec
$vgpr0 = V_MOV_B32_e32 $vgpr1, implicit $exec
$vgpr1 = V_MOV_B32_e32 killed $vgpr3, implicit $exec, implicit $vgpr2, implicit-def $vgpr0_vgpr1, implicit killed $vgpr3
More information about the llvm-commits
mailing list