1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
4 ; NOTE: llvm.amdgcn.wwm is deprecated, use llvm.amdgcn.strict.wwm instead.
6 define amdgpu_hs void @wwm(i32 inreg %arg, ptr addrspace(8) inreg %buffer) {
8 ; GCN: ; %bb.0: ; %entry
9 ; GCN-NEXT: s_mov_b32 s6, s3
10 ; GCN-NEXT: s_mov_b32 s5, s2
11 ; GCN-NEXT: s_or_saveexec_b64 s[2:3], -1
12 ; GCN-NEXT: s_mov_b32 s7, s4
13 ; GCN-NEXT: s_mov_b32 s4, s1
14 ; GCN-NEXT: s_mov_b32 s1, 1
15 ; GCN-NEXT: v_cndmask_b32_e64 v0, 1, 4, s[2:3]
16 ; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0
17 ; GCN-NEXT: s_mov_b64 exec, s[2:3]
18 ; GCN-NEXT: s_cmp_lg_u32 s0, 0
19 ; GCN-NEXT: v_mov_b32_e32 v1, v0
20 ; GCN-NEXT: s_cbranch_scc0 .LBB0_2
21 ; GCN-NEXT: ; %bb.1: ; %bb42
22 ; GCN-NEXT: s_mov_b32 s1, 0
23 ; GCN-NEXT: .LBB0_2: ; %bb602
24 ; GCN-NEXT: v_cmp_ne_u32_e32 vcc, s1, v1
25 ; GCN-NEXT: s_cbranch_vccnz .LBB0_4
26 ; GCN-NEXT: ; %bb.3: ; %bb49
27 ; GCN-NEXT: v_mov_b32_e32 v1, 1.0
28 ; GCN-NEXT: tbuffer_store_format_x v1, off, s[4:7], 1 format:[BUF_DATA_FORMAT_32,BUF_NUM_FORMAT_FLOAT] offset:4 glc
29 ; GCN-NEXT: .LBB0_4: ; %bb54
38 %tmp603 = phi i32 [ 0, %bb42 ], [ 1, %work ]
39 %tmp607 = icmp eq i32 %tmp603, %tmp1196
40 br i1 %tmp607, label %bb49, label %bb54
43 call void @llvm.amdgcn.raw.ptr.tbuffer.store.f32(float 1.0, ptr addrspace(8) %buffer, i32 4, i32 1, i32 116, i32 1)
50 %tmp1189 = tail call i32 @llvm.amdgcn.set.inactive.i32(i32 4, i32 1)
52 %tmp1191 = mul i32 %tmp1189, 4
54 %tmp1196 = tail call i32 @llvm.amdgcn.wwm.i32(i32 %tmp1191)
56 %tmp34 = icmp eq i32 %arg, 0
57 br i1 %tmp34, label %bb602, label %bb42
60 define amdgpu_hs void @strict_wwm(i32 inreg %arg, ptr addrspace(8) inreg %buffer) {
61 ; GCN-LABEL: strict_wwm:
62 ; GCN: ; %bb.0: ; %entry
63 ; GCN-NEXT: s_mov_b32 s6, s3
64 ; GCN-NEXT: s_mov_b32 s5, s2
65 ; GCN-NEXT: s_or_saveexec_b64 s[2:3], -1
66 ; GCN-NEXT: s_mov_b32 s7, s4
67 ; GCN-NEXT: s_mov_b32 s4, s1
68 ; GCN-NEXT: s_mov_b32 s1, 1
69 ; GCN-NEXT: v_cndmask_b32_e64 v0, 1, 4, s[2:3]
70 ; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0
71 ; GCN-NEXT: s_mov_b64 exec, s[2:3]
72 ; GCN-NEXT: s_cmp_lg_u32 s0, 0
73 ; GCN-NEXT: v_mov_b32_e32 v1, v0
74 ; GCN-NEXT: s_cbranch_scc0 .LBB1_2
75 ; GCN-NEXT: ; %bb.1: ; %bb42
76 ; GCN-NEXT: s_mov_b32 s1, 0
77 ; GCN-NEXT: .LBB1_2: ; %bb602
78 ; GCN-NEXT: v_cmp_ne_u32_e32 vcc, s1, v1
79 ; GCN-NEXT: s_cbranch_vccnz .LBB1_4
80 ; GCN-NEXT: ; %bb.3: ; %bb49
81 ; GCN-NEXT: v_mov_b32_e32 v1, 1.0
82 ; GCN-NEXT: tbuffer_store_format_x v1, off, s[4:7], 1 format:[BUF_DATA_FORMAT_32,BUF_NUM_FORMAT_FLOAT] offset:4 glc
83 ; GCN-NEXT: .LBB1_4: ; %bb54
92 %tmp603 = phi i32 [ 0, %bb42 ], [ 1, %work ]
93 %tmp607 = icmp eq i32 %tmp603, %tmp1196
94 br i1 %tmp607, label %bb49, label %bb54
97 call void @llvm.amdgcn.raw.ptr.tbuffer.store.f32(float 1.0, ptr addrspace(8) %buffer, i32 4, i32 1, i32 116, i32 1)
104 %tmp1189 = tail call i32 @llvm.amdgcn.set.inactive.i32(i32 4, i32 1)
106 %tmp1191 = mul i32 %tmp1189, 4
108 %tmp1196 = tail call i32 @llvm.amdgcn.strict.wwm.i32(i32 %tmp1191)
110 %tmp34 = icmp eq i32 %arg, 0
111 br i1 %tmp34, label %bb602, label %bb42
114 declare i32 @llvm.amdgcn.set.inactive.i32(i32, i32) #0
115 declare i32 @llvm.amdgcn.wwm.i32(i32) #1
116 declare i32 @llvm.amdgcn.strict.wwm.i32(i32) #1
117 declare void @llvm.amdgcn.raw.ptr.tbuffer.store.f32(float, ptr addrspace(8), i32, i32, i32 immarg, i32 immarg) #2
119 attributes #0 = { convergent nounwind readnone willreturn }
120 attributes #1 = { convergent nounwind readnone speculatable willreturn }
121 attributes #2 = { nounwind willreturn memory(argmem: write) }