1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/test/CodeGen/AMDGPU/gv-offset-folding.ll
Matt Arsenault dd9ab77318 AMDGPU: Mark all unspecified CC functions in tests as amdgpu_kernel
Currently the default C calling convention functions are treated
the same as compute kernels. Make this explicit so the default
calling convention can be changed to a non-kernel.

Converted with perl -pi -e 's/define void/define amdgpu_kernel void/'
on the relevant test directories (and undoing in one place that actually
wanted a non-kernel).

llvm-svn: 298444
2017-03-21 21:39:51 +00:00

22 lines
866 B
LLVM

; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -mattr=-flat-for-global -relocation-model=static < %s | FileCheck %s
@lds = external addrspace(3) global [4 x i32]
; Function Attrs: nounwind
; Offset folding is an optimization done for global variables with relocations,
; which allows you to store the offset in the r_addend of the relocation entry.
; The offset is apllied to the variables address at link time, which eliminates
; the need to emit shader instructions to do this calculation.
; We don't use relocations for local memory, so we should never fold offsets
; for local memory globals.
; CHECK-LABEL: lds_no_offset:
; CHECK: ds_write_b32 v{{[0-9]+}}, v{{[0-9]+}} offset:4
define amdgpu_kernel void @lds_no_offset() {
entry:
%ptr = getelementptr [4 x i32], [4 x i32] addrspace(3)* @lds, i32 0, i32 1
store i32 0, i32 addrspace(3)* %ptr
ret void
}