1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck %s --check-prefix=GFX9
3 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck %s --check-prefix=GFX10
4 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s --check-prefix=GFX11
6 define amdgpu_kernel void @test0() {
13 ; GFX10-NEXT: s_endpgm
17 ; GFX11-NEXT: s_endpgm
18 tail call void @llvm.amdgcn.endpgm()
22 define void @test1() {
25 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
30 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
31 ; GFX10-NEXT: s_endpgm
35 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
36 ; GFX11-NEXT: s_endpgm
37 tail call void @llvm.amdgcn.endpgm()
41 define amdgpu_kernel void @test2(ptr %p, i32 %x) {
44 ; GFX9-NEXT: s_load_dword s0, s[2:3], 0x2c
45 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
46 ; GFX9-NEXT: s_cmp_lt_i32 s0, 1
47 ; GFX9-NEXT: s_cbranch_scc0 .LBB2_2
48 ; GFX9-NEXT: ; %bb.1: ; %else
49 ; GFX9-NEXT: s_load_dwordx2 s[4:5], s[2:3], 0x24
50 ; GFX9-NEXT: v_mov_b32_e32 v2, s0
51 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
52 ; GFX9-NEXT: v_mov_b32_e32 v0, s4
53 ; GFX9-NEXT: v_mov_b32_e32 v1, s5
54 ; GFX9-NEXT: flat_store_dword v[0:1], v2
56 ; GFX9-NEXT: .LBB2_2: ; %then
61 ; GFX10-NEXT: s_load_dword s0, s[2:3], 0x2c
62 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
63 ; GFX10-NEXT: s_cmp_lt_i32 s0, 1
64 ; GFX10-NEXT: s_cbranch_scc0 .LBB2_2
65 ; GFX10-NEXT: ; %bb.1: ; %else
66 ; GFX10-NEXT: s_load_dwordx2 s[4:5], s[2:3], 0x24
67 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
68 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
69 ; GFX10-NEXT: v_mov_b32_e32 v0, s4
70 ; GFX10-NEXT: v_mov_b32_e32 v1, s5
71 ; GFX10-NEXT: flat_store_dword v[0:1], v2
72 ; GFX10-NEXT: s_endpgm
73 ; GFX10-NEXT: .LBB2_2: ; %then
74 ; GFX10-NEXT: s_endpgm
78 ; GFX11-NEXT: s_load_b32 s0, s[2:3], 0x2c
79 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
80 ; GFX11-NEXT: s_cmp_lt_i32 s0, 1
81 ; GFX11-NEXT: s_cbranch_scc0 .LBB2_2
82 ; GFX11-NEXT: ; %bb.1: ; %else
83 ; GFX11-NEXT: s_load_b64 s[2:3], s[2:3], 0x24
84 ; GFX11-NEXT: v_mov_b32_e32 v2, s0
85 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
86 ; GFX11-NEXT: v_dual_mov_b32 v0, s2 :: v_dual_mov_b32 v1, s3
87 ; GFX11-NEXT: flat_store_b32 v[0:1], v2
88 ; GFX11-NEXT: s_endpgm
89 ; GFX11-NEXT: .LBB2_2: ; %then
90 ; GFX11-NEXT: s_endpgm
91 %cond = icmp sgt i32 %x, 0
92 br i1 %cond, label %then, label %else
95 tail call void @llvm.amdgcn.endpgm()
103 declare void @llvm.amdgcn.endpgm()