1; RUN: llc -mtriple=amdgcn--amdpal -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s 2; RUN: llc -mtriple=amdgcn-- -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s 3; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s 4; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s 5; RUN: llc -mtriple=r600-- -mcpu=cypress < %s | FileCheck -check-prefix=R600 %s 6 7@private1 = private unnamed_addr addrspace(4) constant [4 x float] [float 0.0, float 1.0, float 2.0, float 3.0] 8@private2 = private unnamed_addr addrspace(4) constant [4 x float] [float 4.0, float 5.0, float 6.0, float 7.0] 9@available_externally = available_externally addrspace(4) global [256 x i32] zeroinitializer 10 11; GCN-LABEL: {{^}}private_test: 12; GCN: s_getpc_b64 s{{\[}}[[PC0_LO:[0-9]+]]:[[PC0_HI:[0-9]+]]{{\]}} 13 14; Non-R600 OSes use relocations. 15; GCN: s_add_u32 s{{[0-9]+}}, s[[PC0_LO]], private1@rel32@lo+4 16; GCN: s_addc_u32 s{{[0-9]+}}, s[[PC0_HI]], private1@rel32@hi+12 17; GCN: s_getpc_b64 s{{\[}}[[PC1_LO:[0-9]+]]:[[PC1_HI:[0-9]+]]{{\]}} 18; GCN: s_add_u32 s{{[0-9]+}}, s[[PC1_LO]], private2@rel32@lo+4 19; GCN: s_addc_u32 s{{[0-9]+}}, s[[PC1_HI]], private2@rel32@hi+12 20 21; R600-LABEL: private_test 22define amdgpu_kernel void @private_test(i32 %index, float addrspace(1)* %out) { 23 %ptr = getelementptr [4 x float], [4 x float] addrspace(4) * @private1, i32 0, i32 %index 24 %val = load float, float addrspace(4)* %ptr 25 store volatile float %val, float addrspace(1)* %out 26 %ptr2 = getelementptr [4 x float], [4 x float] addrspace(4) * @private2, i32 0, i32 %index 27 %val2 = load float, float addrspace(4)* %ptr2 28 store volatile float %val2, float addrspace(1)* %out 29 ret void 30} 31 32; GCN-LABEL: {{^}}available_externally_test: 33; GCN: s_getpc_b64 s{{\[}}[[PC0_LO:[0-9]+]]:[[PC0_HI:[0-9]+]]{{\]}} 34; GCN: s_add_u32 s{{[0-9]+}}, s[[PC0_LO]], available_externally@gotpcrel32@lo+4 35; GCN: s_addc_u32 s{{[0-9]+}}, s[[PC0_HI]], available_externally@gotpcrel32@hi+12 36; R600-LABEL: available_externally_test 37define amdgpu_kernel void @available_externally_test(i32 addrspace(1)* %out) { 38 %ptr = getelementptr [256 x i32], [256 x i32] addrspace(4)* @available_externally, i32 0, i32 1 39 %val = load i32, i32 addrspace(4)* %ptr 40 store i32 %val, i32 addrspace(1)* %out 41 ret void 42} 43 44; GCN: .section .rodata 45; R600: .text 46 47; GCN: private1: 48; GCN: private2: 49; R600: private1: 50; R600: private2: 51