mirror of
https://github.com/RPCS3/llvm.git
synced 2026-08-28 05:10:05 -04:00
e536396218
------------------------------------------------------------------------ r292982 | arsenm | 2017-01-24 14:02:15 -0800 (Tue, 24 Jan 2017) | 8 lines Enable FeatureFlatForGlobal on Volcanic Islands This switches to the workaround that HSA defaults to for the mesa path. This should be applied to the 4.0 branch. Patch by Vedran Miletić <vedran@miletic.net> ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@293326 91177308-0d34-0410-b5e6-96231b3b80d8
22 lines
851 B
LLVM
22 lines
851 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 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
|
|
}
|