• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -O0 -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCNNOOPT -check-prefix=GCN %s
2; RUN: llc -O0 -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCNNOOPT -check-prefix=GCN %s
3; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCNOPT -check-prefix=GCN %s
4; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCNOPT -check-prefix=GCN %s
5
6; GCN-LABEL: {{^}}test_branch:
7; GCNNOOPT: v_writelane_b32
8; GCNNOOPT: v_writelane_b32
9; GCNNOOPT: v_writelane_b32
10; GCN: s_cbranch_scc1 [[END:BB[0-9]+_[0-9]+]]
11
12; GCN: ; BB#1
13; GCNNOOPT: v_readlane_b32
14; GCNNOOPT: v_readlane_b32
15; GCN: buffer_store_dword
16; GCN: s_endpgm
17
18; GCN: {{^}}[[END]]
19; GCN: s_endpgm
20define void @test_branch(i32 addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in, i32 %val) #0 {
21  %cmp = icmp ne i32 %val, 0
22  br i1 %cmp, label %store, label %end
23
24store:
25  store i32 222, i32 addrspace(1)* %out
26  ret void
27
28end:
29  ret void
30}
31
32; GCN-LABEL: {{^}}test_brcc_i1:
33; GCN: buffer_load_ubyte
34; GCN: v_and_b32_e32 v{{[0-9]+}}, 1,
35; GCN: v_cmp_eq_i32_e32 vcc,
36; GCN: s_cbranch_vccnz [[END:BB[0-9]+_[0-9]+]]
37
38; GCN: buffer_store_dword
39; GCN: s_endpgm
40
41; GCN: {{^}}[[END]]
42; GCN: s_endpgm
43define void @test_brcc_i1(i32 addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in, i1 %val) #0 {
44  %cmp0 = icmp ne i1 %val, 0
45  br i1 %cmp0, label %store, label %end
46
47store:
48  store i32 222, i32 addrspace(1)* %out
49  ret void
50
51end:
52  ret void
53}
54
55attributes #0 = { nounwind }
56