Skip to content

Commit 5c8eb83

Browse files
committed
[AMDGPU] Generate test fix-wwm-vgpr-copy.ll (NFC)
1 parent 4ca024c commit 5c8eb83

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed

llvm/test/CodeGen/AMDGPU/fix-wwm-vgpr-copy.ll

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
12
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
23

34
; NOTE: llvm.amdgcn.wwm is deprecated, use llvm.amdgcn.strict.wwm instead.
45

56
; GCN-LABEL: wwm:
67
define amdgpu_hs void @wwm(i32 inreg %arg, ptr addrspace(8) inreg %buffer) {
8+
; GCN-LABEL: wwm:
9+
; GCN: ; %bb.0: ; %entry
10+
; GCN-NEXT: s_mov_b32 s7, s4
11+
; GCN-NEXT: s_mov_b32 s6, s3
12+
; GCN-NEXT: s_mov_b32 s5, s2
13+
; GCN-NEXT: s_mov_b32 s4, s1
14+
; GCN-NEXT: s_mov_b32 s1, 1
15+
; GCN-NEXT: v_mov_b32_e32 v0, 4
16+
; GCN-NEXT: s_not_b64 exec, exec
17+
; GCN-NEXT: v_mov_b32_e32 v0, 1
18+
; GCN-NEXT: s_not_b64 exec, exec
19+
; GCN-NEXT: s_or_saveexec_b64 s[2:3], -1
20+
; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0
21+
; GCN-NEXT: s_mov_b64 exec, s[2:3]
22+
; GCN-NEXT: s_cmp_lg_u32 s0, 0
23+
; GCN-NEXT: v_mov_b32_e32 v1, v0
24+
; GCN-NEXT: s_cbranch_scc0 .LBB0_2
25+
; GCN-NEXT: ; %bb.1: ; %bb42
26+
; GCN-NEXT: s_mov_b32 s1, 0
27+
; GCN-NEXT: .LBB0_2: ; %bb602
28+
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, s1, v1
29+
; GCN-NEXT: s_cbranch_vccnz .LBB0_4
30+
; GCN-NEXT: ; %bb.3: ; %bb49
31+
; GCN-NEXT: v_mov_b32_e32 v1, 1.0
32+
; GCN-NEXT: tbuffer_store_format_x v1, off, s[4:7], 1 format:[BUF_DATA_FORMAT_32,BUF_NUM_FORMAT_FLOAT] offset:4 glc
33+
; GCN-NEXT: .LBB0_4: ; %bb54
34+
; GCN-NEXT: s_endpgm
735
entry:
836
br label %work
937

@@ -23,16 +51,10 @@ bb54:
2351
ret void
2452

2553
work:
26-
; GCN: s_not_b64 exec, exec
27-
; GCN: v_mov_b32_e32 v[[tmp1189:[0-9]+]], 1
28-
; GCN: s_not_b64 exec, exec
2954
%tmp1189 = tail call i32 @llvm.amdgcn.set.inactive.i32(i32 4, i32 1)
3055

31-
; GCN: s_or_saveexec_b64 s[[[LO:[0-9]+]]:[[HI:[0-9]+]]], -1
32-
; GCN: v_lshlrev_b32_e32 v[[tmp1191:[0-9]+]], 2, v[[tmp1189]]
3356
%tmp1191 = mul i32 %tmp1189, 4
3457

35-
; GCN: s_mov_b64 exec, s[[[LO]]:[[HI]]]
3658
%tmp1196 = tail call i32 @llvm.amdgcn.wwm.i32(i32 %tmp1191)
3759

3860
%tmp34 = icmp eq i32 %arg, 0
@@ -41,6 +63,33 @@ work:
4163

4264
; GCN-LABEL: strict_wwm:
4365
define amdgpu_hs void @strict_wwm(i32 inreg %arg, ptr addrspace(8) inreg %buffer) {
66+
; GCN-LABEL: strict_wwm:
67+
; GCN: ; %bb.0: ; %entry
68+
; GCN-NEXT: s_mov_b32 s7, s4
69+
; GCN-NEXT: s_mov_b32 s6, s3
70+
; GCN-NEXT: s_mov_b32 s5, s2
71+
; GCN-NEXT: s_mov_b32 s4, s1
72+
; GCN-NEXT: s_mov_b32 s1, 1
73+
; GCN-NEXT: v_mov_b32_e32 v0, 4
74+
; GCN-NEXT: s_not_b64 exec, exec
75+
; GCN-NEXT: v_mov_b32_e32 v0, 1
76+
; GCN-NEXT: s_not_b64 exec, exec
77+
; GCN-NEXT: s_or_saveexec_b64 s[2:3], -1
78+
; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0
79+
; GCN-NEXT: s_mov_b64 exec, s[2:3]
80+
; GCN-NEXT: s_cmp_lg_u32 s0, 0
81+
; GCN-NEXT: v_mov_b32_e32 v1, v0
82+
; GCN-NEXT: s_cbranch_scc0 .LBB1_2
83+
; GCN-NEXT: ; %bb.1: ; %bb42
84+
; GCN-NEXT: s_mov_b32 s1, 0
85+
; GCN-NEXT: .LBB1_2: ; %bb602
86+
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, s1, v1
87+
; GCN-NEXT: s_cbranch_vccnz .LBB1_4
88+
; GCN-NEXT: ; %bb.3: ; %bb49
89+
; GCN-NEXT: v_mov_b32_e32 v1, 1.0
90+
; GCN-NEXT: tbuffer_store_format_x v1, off, s[4:7], 1 format:[BUF_DATA_FORMAT_32,BUF_NUM_FORMAT_FLOAT] offset:4 glc
91+
; GCN-NEXT: .LBB1_4: ; %bb54
92+
; GCN-NEXT: s_endpgm
4493
entry:
4594
br label %work
4695

@@ -60,16 +109,10 @@ bb54:
60109
ret void
61110

62111
work:
63-
; GCN: s_not_b64 exec, exec
64-
; GCN: v_mov_b32_e32 v[[tmp1189:[0-9]+]], 1
65-
; GCN: s_not_b64 exec, exec
66112
%tmp1189 = tail call i32 @llvm.amdgcn.set.inactive.i32(i32 4, i32 1)
67113

68-
; GCN: s_or_saveexec_b64 s[[[LO:[0-9]+]]:[[HI:[0-9]+]]], -1
69-
; GCN: v_lshlrev_b32_e32 v[[tmp1191:[0-9]+]], 2, v[[tmp1189]]
70114
%tmp1191 = mul i32 %tmp1189, 4
71115

72-
; GCN: s_mov_b64 exec, s[[[LO]]:[[HI]]]
73116
%tmp1196 = tail call i32 @llvm.amdgcn.strict.wwm.i32(i32 %tmp1191)
74117

75118
%tmp34 = icmp eq i32 %arg, 0

0 commit comments

Comments
 (0)