brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · fc316b7 Raw
60 lines · plain
1; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=+flat-for-global | FileCheck -check-prefix=HSA -check-prefix=HSA-DEFAULT -check-prefix=ALL %s2; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-flat-for-global | FileCheck -check-prefix=HSA -check-prefix=HSA-NODEFAULT -check-prefix=ALL %s3; RUN: llc < %s -mtriple=amdgcn-- -mcpu=tonga | FileCheck -check-prefix=HSA-NOADDR64 -check-prefix=ALL %s4; RUN: llc < %s -mtriple=amdgcn-- -mcpu=kaveri -mattr=-flat-for-global | FileCheck -check-prefix=NOHSA-DEFAULT -check-prefix=ALL %s5; RUN: llc < %s -mtriple=amdgcn-- -mcpu=kaveri -mattr=+flat-for-global | FileCheck -check-prefix=NOHSA-NODEFAULT -check-prefix=ALL %s6; RUN: llc < %s -mtriple=amdgcn-- -mcpu=tonga | FileCheck -check-prefix=NOHSA-NOADDR64 -check-prefix=ALL %s7 8 9; There are no stack objects even though flat is used by default, so10; flat_scratch_init should be disabled.11 12; ALL-LABEL: {{^}}test:13 14; ALL-NOT: flat_scr15 16; HSA-DEFAULT: flat_store_dword17; HSA-NODEFAULT: buffer_store_dword18; HSA-NOADDR64: flat_store_dword19 20; HSA: .amdhsa_user_sgpr_flat_scratch_init 021 22; NOHSA-DEFAULT: buffer_store_dword23; NOHSA-NODEFAULT: flat_store_dword24; NOHSA-NOADDR64: flat_store_dword25define amdgpu_kernel void @test(ptr addrspace(1) %out) #0 {26entry:27  store i32 0, ptr addrspace(1) %out28  ret void29}30 31; ALL-LABEL: {{^}}test_addr64:32 33; HSA-DEFAULT: flat_store_dword34; HSA-NODEFAULT: buffer_store_dword35; HSA-NOADDR64: flat_store_dword36 37; NOHSA-DEFAULT: buffer_store_dword38; NOHSA-NODEFAULT: flat_store_dword39; NOHSA-NOADDR64: flat_store_dword40define amdgpu_kernel void @test_addr64(ptr addrspace(1) %out) #0 {41entry:42  %out.addr = alloca ptr addrspace(1), align 4, addrspace(5)43 44  store ptr addrspace(1) %out, ptr addrspace(5) %out.addr, align 445  %ld0 = load ptr addrspace(1), ptr addrspace(5) %out.addr, align 446 47  store i32 1, ptr addrspace(1) %ld0, align 448 49  %ld1 = load ptr addrspace(1), ptr addrspace(5) %out.addr, align 450  %arrayidx1 = getelementptr inbounds i32, ptr addrspace(1) %ld1, i32 151  store i32 2, ptr addrspace(1) %arrayidx1, align 452 53  ret void54}55 56attributes #0 = { "amdgpu-no-flat-scratch-init" }57 58!llvm.module.flags = !{!0}59!0 = !{i32 1, !"amdhsa_code_object_version", i32 400}60