Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/CodeGen/AMDGPU/local-memory.ll
1 | ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s | 1 | ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s | ||
---|---|---|---|---|---|
2 | ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s | 2 | ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s | ||
3 | ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s | 3 | ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s | ||
4 | 4 | | |||
5 | @local_memory.local_mem = internal unnamed_addr addrspace(3) global [128 x i32] undef, align 4 | 5 | @local_memory.local_mem = internal unnamed_addr addrspace(3) global [128 x i32] undef, align 4 | ||
6 | 6 | | |||
7 | @lds = addrspace(3) global [512 x i32] undef, align 4 | 7 | @lds = addrspace(3) global [512 x i32] undef, align 4 | ||
8 | 8 | | |||
9 | ; On SI we need to make sure that the base offset is a register and | 9 | ; On SI we need to make sure that the base offset is a register and | ||
10 | ; not an immediate. | 10 | ; not an immediate. | ||
11 | 11 | | |||
12 | ; FUNC-LABEL: {{^}}load_i32_local_const_ptr: | 12 | ; FUNC-LABEL: {{^}}load_i32_local_const_ptr: | ||
13 | ; GCN: v_mov_b32_e32 v[[ZERO:[0-9]+]], 0 | 13 | ; GCN: v_mov_b32_e32 v[[PTR:[0-9]+]], lds@abs32@lo | ||
14 | ; GCN: ds_read_b32 v{{[0-9]+}}, v[[ZERO]] offset:4 | 14 | ; GCN: ds_read_b32 v{{[0-9]+}}, v[[PTR]] offset:4 | ||
15 | 15 | | |||
16 | ; R600: LDS_READ_RET | 16 | ; R600: LDS_READ_RET | ||
17 | define amdgpu_kernel void @load_i32_local_const_ptr(i32 addrspace(1)* %out, i32 addrspace(3)* %in) #0 { | 17 | define amdgpu_kernel void @load_i32_local_const_ptr(i32 addrspace(1)* %out, i32 addrspace(3)* %in) #0 { | ||
18 | entry: | 18 | entry: | ||
19 | %tmp0 = getelementptr [512 x i32], [512 x i32] addrspace(3)* @lds, i32 0, i32 1 | 19 | %tmp0 = getelementptr [512 x i32], [512 x i32] addrspace(3)* @lds, i32 0, i32 1 | ||
20 | %tmp1 = load i32, i32 addrspace(3)* %tmp0 | 20 | %tmp1 = load i32, i32 addrspace(3)* %tmp0 | ||
21 | %tmp2 = getelementptr i32, i32 addrspace(1)* %out, i32 1 | 21 | %tmp2 = getelementptr i32, i32 addrspace(1)* %out, i32 1 | ||
22 | store i32 %tmp1, i32 addrspace(1)* %tmp2 | 22 | store i32 %tmp1, i32 addrspace(1)* %tmp2 | ||
Show All 22 Lines |