xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/ci-use-flat-for-global.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=+flat-for-global < %s | FileCheck -check-prefix=HSA -check-prefix=HSA-DEFAULT -check-prefix=ALL %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-flat-for-global < %s | FileCheck -check-prefix=HSA -check-prefix=HSA-NODEFAULT -check-prefix=ALL %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=amdgcn-- -mcpu=kaveri -mattr=-flat-for-global < %s | FileCheck -check-prefix=NOHSA-DEFAULT -check-prefix=ALL %s
4*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=amdgcn-- -mcpu=kaveri -mattr=+flat-for-global < %s | FileCheck -check-prefix=NOHSA-NODEFAULT -check-prefix=ALL %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; There are no stack objects even though flat is used by default, so
8*9880d681SAndroid Build Coastguard Worker; flat_scratch_init should be disabled.
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: {{^}}test:
11*9880d681SAndroid Build Coastguard Worker; HSA: .amd_kernel_code_t
12*9880d681SAndroid Build Coastguard Worker; HSA: enable_sgpr_flat_scratch_init = 0
13*9880d681SAndroid Build Coastguard Worker; HSA: .end_amd_kernel_code_t
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; ALL-NOT: flat_scr
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker; HSA-DEFAULT: flat_store_dword
18*9880d681SAndroid Build Coastguard Worker; HSA-NODEFAULT: buffer_store_dword
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker; NOHSA-DEFAULT: buffer_store_dword
21*9880d681SAndroid Build Coastguard Worker; NOHSA-NODEFAULT: flat_store_dword
22*9880d681SAndroid Build Coastguard Workerdefine void @test(i32 addrspace(1)* %out) {
23*9880d681SAndroid Build Coastguard Workerentry:
24*9880d681SAndroid Build Coastguard Worker  store i32 0, i32 addrspace(1)* %out
25*9880d681SAndroid Build Coastguard Worker  ret void
26*9880d681SAndroid Build Coastguard Worker}
27