Skip to content

Commit acd0714

Browse files
mssefatvar-const
authored andcommitted
[nfc][AMDGPU] Autogenerated assertions applied to fold-imm-copy.mir (llvm#135071)
Autogenerated assertions are applied to fold-imm-copy.mir
1 parent 365ef9f commit acd0714

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

llvm/test/CodeGen/AMDGPU/fold-imm-copy.mir

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
12
# RUN: llc -mtriple=amdgcn -run-pass si-fold-operands -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
23

3-
# GCN-LABEL: name: fold-imm-copy
4-
# GCN: V_AND_B32_e32 65535
5-
64
---
75
name: fold-imm-copy
86
tracksRegLiveness: true
97
body: |
108
bb.0:
119
liveins: $vgpr0, $sgpr0_sgpr1
10+
; GCN-LABEL: name: fold-imm-copy
11+
; GCN: liveins: $vgpr0, $sgpr0_sgpr1
12+
; GCN-NEXT: {{ $}}
13+
; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
14+
; GCN-NEXT: [[COPY1:%[0-9]+]]:sgpr_64 = COPY $sgpr0_sgpr1
15+
; GCN-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY1]], 9, 0
16+
; GCN-NEXT: [[V_LSHLREV_B32_e64_:%[0-9]+]]:vgpr_32 = V_LSHLREV_B32_e64 2, [[COPY]], implicit $exec
17+
; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
18+
; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE killed [[V_LSHLREV_B32_e64_]], %subreg.sub0, killed [[V_MOV_B32_e32_]], %subreg.sub1
19+
; GCN-NEXT: [[BUFFER_LOAD_DWORD_ADDR64_:%[0-9]+]]:vgpr_32 = BUFFER_LOAD_DWORD_ADDR64 [[REG_SEQUENCE]], [[S_LOAD_DWORDX4_IMM]], 0, 4, 0, 0, implicit $exec
20+
; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 65535, [[BUFFER_LOAD_DWORD_ADDR64_]], implicit $exec
1221
%0:vgpr_32 = COPY $vgpr0
1322
%1:sgpr_64 = COPY $sgpr0_sgpr1
1423
%2:sgpr_128 = S_LOAD_DWORDX4_IMM %1, 9, 0
@@ -23,14 +32,19 @@ body: |
2332
...
2433

2534
---
26-
# GCN-LABEL: name: no_extra_fold_on_same_opnd
2735
# The first XOR needs commuting to fold that immediate operand.
28-
# GCN: V_XOR_B32_e32 0, %1
29-
# GCN: V_XOR_B32_e32 %2, %4.sub0
3036
name: no_extra_fold_on_same_opnd
3137
tracksRegLiveness: true
3238
body: |
3339
bb.0:
40+
; GCN-LABEL: name: no_extra_fold_on_same_opnd
41+
; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
42+
; GCN-NEXT: [[DEF1:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
43+
; GCN-NEXT: [[DEF2:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
44+
; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
45+
; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE killed [[DEF]], %subreg.sub0, killed [[V_MOV_B32_e32_]], %subreg.sub1
46+
; GCN-NEXT: [[V_XOR_B32_e32_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e32 0, [[DEF1]], implicit $exec
47+
; GCN-NEXT: [[V_XOR_B32_e32_1:%[0-9]+]]:vgpr_32 = V_XOR_B32_e32 [[DEF2]], [[REG_SEQUENCE]].sub0, implicit $exec
3448
%0:vgpr_32 = IMPLICIT_DEF
3549
%1:vgpr_32 = IMPLICIT_DEF
3650
%2:vgpr_32 = IMPLICIT_DEF
@@ -45,42 +59,44 @@ body: |
4559
# Make sure the subreg index is not reinterpreted when folding
4660
# immediates
4761
#
48-
# GCN-LABEL: name: clear_subreg_imm_fold{{$}}
49-
# GCN: %1:sgpr_32 = S_MOV_B32 4294967288
50-
# GCN: %2:sgpr_32 = S_MOV_B32 4294967295
5162
name: clear_subreg_imm_fold
5263
tracksRegLiveness: true
5364
body: |
5465
bb.0:
66+
; GCN-LABEL: name: clear_subreg_imm_fold
67+
; GCN: [[S_MOV_B32_:%[0-9]+]]:sgpr_32 = S_MOV_B32 4294967288
68+
; GCN-NEXT: [[S_MOV_B32_1:%[0-9]+]]:sgpr_32 = S_MOV_B32 4294967295
69+
; GCN-NEXT: S_ENDPGM 0, implicit [[S_MOV_B32_]], implicit [[S_MOV_B32_1]]
5570
%0:sreg_64 = S_MOV_B64 -8
5671
%1:sgpr_32 = COPY %0.sub0
5772
%2:sgpr_32 = COPY %0.sub1
5873
S_ENDPGM 0, implicit %1, implicit %2
5974
6075
...
6176

62-
# GCN-LABEL: name: no_fold_imm_into_m0{{$}}
63-
# GCN: %0:sreg_32 = S_MOV_B32 -8
64-
# GCN-NEXT: $m0 = COPY %0
65-
6677
---
6778
name: no_fold_imm_into_m0
6879
tracksRegLiveness: true
6980
body: |
7081
bb.0:
82+
; GCN-LABEL: name: no_fold_imm_into_m0
83+
; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 -8
84+
; GCN-NEXT: $m0 = COPY [[S_MOV_B32_]]
85+
; GCN-NEXT: S_ENDPGM 0, implicit $m0
7186
%0:sreg_32 = S_MOV_B32 -8
7287
$m0 = COPY %0
7388
S_ENDPGM 0, implicit $m0
7489
7590
...
7691

77-
# GCN-LABEL: name: fold_sgpr_imm_to_vgpr_copy{{$}}
78-
# GCN: $vgpr0 = V_MOV_B32_e32 -8, implicit $exec
7992
---
8093
name: fold_sgpr_imm_to_vgpr_copy
8194
tracksRegLiveness: true
8295
body: |
8396
bb.0:
97+
; GCN-LABEL: name: fold_sgpr_imm_to_vgpr_copy
98+
; GCN: $vgpr0 = V_MOV_B32_e32 -8, implicit $exec
99+
; GCN-NEXT: S_ENDPGM 0, implicit $vgpr0
84100
%0:sreg_32 = S_MOV_B32 -8
85101
$vgpr0 = COPY %0
86102
S_ENDPGM 0, implicit $vgpr0
@@ -90,16 +106,17 @@ body: |
90106
# The users of $vgpr1 should not be visited for further immediate
91107
# folding.
92108

93-
# GCN-LABEL: name: no_fold_physreg_users_vgpr{{$}}
94-
# GCN: $vgpr1 = V_MOV_B32_e32 0, implicit $exec
95-
# GCN-NEXT: S_NOP 0, implicit-def $vgpr1
96-
# GCN-NEXT: %2:vgpr_32 = COPY $vgpr1
97-
# GCN-NEXT: $vgpr2 = COPY %2
98109
---
99110
name: no_fold_physreg_users_vgpr
100111
tracksRegLiveness: true
101112
body: |
102113
bb.0:
114+
; GCN-LABEL: name: no_fold_physreg_users_vgpr
115+
; GCN: $vgpr1 = V_MOV_B32_e32 0, implicit $exec
116+
; GCN-NEXT: S_NOP 0, implicit-def $vgpr1
117+
; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr1
118+
; GCN-NEXT: $vgpr2 = COPY [[COPY]]
119+
; GCN-NEXT: S_ENDPGM 0
103120
%0:sreg_32 = S_MOV_B32 0
104121
%1:vgpr_32 = COPY %0
105122
$vgpr1 = COPY %0

0 commit comments

Comments
 (0)