1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

AMDGPU: Fix ValueKind code object metadata for images

Differential Revision: https://reviews.llvm.org/D32504

llvm-svn: 301360
This commit is contained in:
Konstantin Zhuravlyov 2017-04-25 20:38:26 +00:00
parent 7e23fb51e1
commit 568217ba62
2 changed files with 92 additions and 12 deletions

View File

@ -286,20 +286,20 @@ ValueKind MetadataStreamer::getValueKind(Type *Ty, StringRef TypeQual,
return ValueKind::Pipe;
return StringSwitch<ValueKind>(BaseTypeName)
.Case("image1d_t", ValueKind::Image)
.Case("image1d_array_t", ValueKind::Image)
.Case("image1d_buffer_t", ValueKind::Image)
.Case("image2d_t", ValueKind::Image)
.Case("image2d_array_t", ValueKind::Image)
.Case("image2d_array_depth_t", ValueKind::Image)
.Case("image2d_array_msaa_t", ValueKind::Image)
.Case("image2d_array_msaa_depth_t", ValueKind::Image)
.Case("image2d_depth_t", ValueKind::Image)
.Case("image2d_msaa_t", ValueKind::Image)
.Case("image2d_msaa_depth_t", ValueKind::Image)
.Case("image3d_t", ValueKind::Image)
.Case("sampler_t", ValueKind::Sampler)
.Case("queue_t", ValueKind::Queue)
.Cases("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", ValueKind::Image)
.Default(isa<PointerType>(Ty) ?
(Ty->getPointerAddressSpace() ==
AMDGPUASI.LOCAL_ADDRESS ?

View File

@ -0,0 +1,80 @@
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -filetype=obj -o - < %s | llvm-readobj -amdgpu-code-object-metadata -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=NOTES %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx800 -filetype=obj -o - < %s | llvm-readobj -amdgpu-code-object-metadata -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX800 --check-prefix=NOTES %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readobj -amdgpu-code-object-metadata -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %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: Version: [ 1, 0 ]
; CHECK: Kernels:
; CHECK: - Name: test
; CHECK: Args:
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image1d_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image1d_array_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image1d_buffer_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_array_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_array_depth_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_array_msaa_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_array_msaa_depth_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_depth_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_msaa_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image2d_msaa_depth_t
; CHECK: - Size: 8
; CHECK: ValueKind: Image
; CHECK: TypeName: image3d_t
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
}
!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"}