• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=amdgcn-amd-amdhsa --amdhsa-code-object-version=2 < %s | FileCheck -check-prefix=ALL -check-prefix=HSA %s
2; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=ALL -check-prefix=EG %s
3
4; This test makes sure we do not double count global values when they are
5; used in different basic blocks.
6
7; GCN: .long 47180
8; GCN-NEXT: .long 32900
9
10; EG: .long 166120
11; EG-NEXT: .long 1
12; ALL: {{^}}test:
13
14; HSA: granulated_lds_size = 0
15; HSA: workgroup_group_segment_byte_size = 4
16
17; GCN: ; LDSByteSize: 4 bytes/workgroup (compile time only)
18@lds = internal unnamed_addr addrspace(3) global i32 undef, align 4
19
20define amdgpu_kernel void @test(i32 addrspace(1)* %out, i32 %cond) {
21entry:
22  %0 = icmp eq i32 %cond, 0
23  br i1 %0, label %if, label %else
24
25if:
26  store i32 1, i32 addrspace(3)* @lds
27  br label %endif
28
29else:
30  store i32 2, i32 addrspace(3)* @lds
31  br label %endif
32
33endif:
34  ret void
35}
36