Skip to content

Commit 8187caf

Browse files
authored
[NFC][AMDGPU] Pre-commit a test case of checking register coalescer on v_pk_mov_b32 (#127715)
This PR serves as a preliminary step, adding a test case for register coalescer on v_pk_mov_b32. It is intended to demonstrate the code changes introduced in an upcoming PR.
1 parent 27e6561 commit 8187caf

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2+
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -run-pass=register-coalescer -o - %s | FileCheck %s
3+
4+
---
5+
name: test_remat_v_pk_mov_b32
6+
tracksRegLiveness: true
7+
body: |
8+
; CHECK-LABEL: name: test_remat_v_pk_mov_b32
9+
; CHECK: bb.0:
10+
; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
11+
; CHECK-NEXT: liveins: $sgpr0
12+
; CHECK-NEXT: {{ $}}
13+
; CHECK-NEXT: [[V_PK_MOV_B32_:%[0-9]+]]:vreg_64_align2 = V_PK_MOV_B32 8, 0, 8, 0, 0, 0, 0, 0, 0, implicit $exec
14+
; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_64_align2 = COPY [[V_PK_MOV_B32_]]
15+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = COPY [[V_PK_MOV_B32_]]
16+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:sreg_64 = COPY $sgpr0
17+
; CHECK-NEXT: $exec = S_MOV_B64_term [[COPY2]]
18+
; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
19+
; CHECK-NEXT: S_BRANCH %bb.1
20+
; CHECK-NEXT: {{ $}}
21+
; CHECK-NEXT: bb.1:
22+
; CHECK-NEXT: successors: %bb.2(0x80000000)
23+
; CHECK-NEXT: {{ $}}
24+
; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_64_align2 = V_PK_ADD_F32 8, [[COPY]], 8, [[COPY]], 11, 0, 0, 0, 0, implicit $mode, implicit $exec
25+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = V_PK_ADD_F32 8, [[COPY1]], 8, [[COPY1]], 11, 0, 0, 0, 0, implicit $mode, implicit $exec
26+
; CHECK-NEXT: {{ $}}
27+
; CHECK-NEXT: bb.2:
28+
; CHECK-NEXT: S_NOP 0, implicit [[COPY]]
29+
; CHECK-NEXT: S_NOP 0, implicit [[COPY1]]
30+
; CHECK-NEXT: S_ENDPGM 0, implicit [[V_PK_MOV_B32_]]
31+
bb.0:
32+
liveins: $sgpr0
33+
%0:vreg_64_align2 = V_PK_MOV_B32 8, 0, 8, 0, 0, 0, 0, 0, 0, implicit $exec
34+
%1:vreg_64_align2 = COPY %0:vreg_64_align2
35+
%2:vreg_64_align2 = COPY %0:vreg_64_align2
36+
%3:sreg_64 = COPY $sgpr0
37+
$exec = S_MOV_B64_term %3:sreg_64
38+
S_CBRANCH_EXECZ %bb.2, implicit $exec
39+
S_BRANCH %bb.1
40+
41+
bb.1:
42+
%1:vreg_64_align2 = V_PK_ADD_F32 8, %1, 8, %1, 11, 0, 0, 0, 0, implicit $mode, implicit $exec
43+
%2:vreg_64_align2 = V_PK_ADD_F32 8, %2, 8, %2, 11, 0, 0, 0, 0, implicit $mode, implicit $exec
44+
45+
bb.2:
46+
S_NOP 0, implicit %1
47+
S_NOP 0, implicit %2
48+
S_ENDPGM 0, implicit %0
49+
...

0 commit comments

Comments
 (0)