1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/AMDGPU/hsa-metadata-images-v3.ll
Konstantin Zhuravlyov a76ecb87cf AMDGPU: Add target id and code object v4 support
- Add target id support (https://clang.llvm.org/docs/ClangOffloadBundler.html#target-id)
  - Add code object v4 support (https://llvm.org/docs/AMDGPUUsage.html#elf-code-object)
    - Add kernarg_size to kernel descriptor
    - Change trap handler ABI to no longer move queue pointer into s[0:1]
  - Cleanup ELF definitions
    - Add V2, V3, V4 suffixes to make a clear distinction for code object version
    - Consolidate note names

Differential Revision: https://reviews.llvm.org/D95638
2021-03-24 11:54:05 -04:00

118 lines
5.1 KiB
LLVM

; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx802 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
%opencl.image1d_t = type opaque
%opencl.image1d_array_t = type opaque
%opencl.image1d_buffer_t = type opaque
%opencl.image2d_t = type opaque
%opencl.image2d_array_t = type opaque
%opencl.image2d_array_depth_t = type opaque
%opencl.image2d_array_msaa_t = type opaque
%opencl.image2d_array_msaa_depth_t = type opaque
%opencl.image2d_depth_t = type opaque
%opencl.image2d_msaa_t = type opaque
%opencl.image2d_msaa_depth_t = type opaque
%opencl.image3d_t = type opaque
; CHECK: ---
; CHECK: amdhsa.kernels:
; CHECK: - .args:
; CHECK: - .address_space: global
; CHECK: .name: a
; CHECK: .offset: 0
; CHECK: .size: 8
; CHECK: .type_name: image1d_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: b
; CHECK: .offset: 8
; CHECK: .size: 8
; CHECK: .type_name: image1d_array_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: c
; CHECK: .offset: 16
; CHECK: .size: 8
; CHECK: .type_name: image1d_buffer_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: d
; CHECK: .offset: 24
; CHECK: .size: 8
; CHECK: .type_name: image2d_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: e
; CHECK: .offset: 32
; CHECK: .size: 8
; CHECK: .type_name: image2d_array_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: f
; CHECK: .offset: 40
; CHECK: .size: 8
; CHECK: .type_name: image2d_array_depth_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: g
; CHECK: .offset: 48
; CHECK: .size: 8
; CHECK: .type_name: image2d_array_msaa_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: h
; CHECK: .offset: 56
; CHECK: .size: 8
; CHECK: .type_name: image2d_array_msaa_depth_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: i
; CHECK: .offset: 64
; CHECK: .size: 8
; CHECK: .type_name: image2d_depth_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: j
; CHECK: .offset: 72
; CHECK: .size: 8
; CHECK: .type_name: image2d_msaa_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: k
; CHECK: .offset: 80
; CHECK: .size: 8
; CHECK: .type_name: image2d_msaa_depth_t
; CHECK: .value_kind: image
; CHECK: - .address_space: global
; CHECK: .name: l
; CHECK: .offset: 88
; CHECK: .size: 8
; CHECK: .type_name: image3d_t
; CHECK: .value_kind: image
define amdgpu_kernel void @test(%opencl.image1d_t addrspace(1)* %a,
%opencl.image1d_array_t addrspace(1)* %b,
%opencl.image1d_buffer_t addrspace(1)* %c,
%opencl.image2d_t addrspace(1)* %d,
%opencl.image2d_array_t addrspace(1)* %e,
%opencl.image2d_array_depth_t addrspace(1)* %f,
%opencl.image2d_array_msaa_t addrspace(1)* %g,
%opencl.image2d_array_msaa_depth_t addrspace(1)* %h,
%opencl.image2d_depth_t addrspace(1)* %i,
%opencl.image2d_msaa_t addrspace(1)* %j,
%opencl.image2d_msaa_depth_t addrspace(1)* %k,
%opencl.image3d_t addrspace(1)* %l)
!kernel_arg_type !1 !kernel_arg_base_type !1 {
ret void
}
; CHECK: amdhsa.version:
; CHECK-NEXT: - 1
; CHECK-NEXT: - 0
!1 = !{!"image1d_t", !"image1d_array_t", !"image1d_buffer_t",
!"image2d_t", !"image2d_array_t", !"image2d_array_depth_t",
!"image2d_array_msaa_t", !"image2d_array_msaa_depth_t",
!"image2d_depth_t", !"image2d_msaa_t", !"image2d_msaa_depth_t",
!"image3d_t"}