[PATCH] D63850: [AMDGPU] Kernel arg metadata: added support for "__hip_texture" type.
Konstantin Pyzhov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 08:06:25 PDT 2019
kpyzhov updated this revision to Diff 207799.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63850/new/
https://reviews.llvm.org/D63850
Files:
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full-v3.ll
llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full.ll
Index: llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full.ll
+++ llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full.ll
@@ -13,6 +13,7 @@
%opencl.pipe_t = type opaque
%struct.B = type { i32 addrspace(1)*}
%opencl.clk_event_t = type opaque
+%struct.__hip_texture = type opaque
@__test_block_invoke_kernel_runtime_handle = external addrspace(1) externally_initialized constant i8 addrspace(1)*
@@ -1484,6 +1485,16 @@
ret void
}
+; CHECK: - Name: _Z5EmptyP13__hip_texture
+; CHECK: Args:
+; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: Align: 8
+; CHECK-NEXT: ValueKind: Image
+; CHECK-NEXT: ValueType: Struct
+define protected amdgpu_kernel void @_Z5EmptyP13__hip_texture(%struct.__hip_texture* nocapture) local_unnamed_addr #1 {
+ ret void
+}
+
attributes #0 = { "amdgpu-implicitarg-num-bytes"="48" }
attributes #1 = { "amdgpu-implicitarg-num-bytes"="48" "runtime-handle"="__test_block_invoke_kernel_runtime_handle" }
attributes #2 = { "amdgpu-implicitarg-num-bytes"="48" "calls-enqueue-kernel" }
Index: llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full-v3.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full-v3.ll
+++ llvm/test/CodeGen/AMDGPU/hsa-metadata-from-llvm-ir-full-v3.ll
@@ -13,6 +13,7 @@
%opencl.pipe_t = type opaque
%struct.B = type { i32 addrspace(1)*}
%opencl.clk_event_t = type opaque
+%struct.__hip_texture = type opaque
@__test_block_invoke_kernel_runtime_handle = external addrspace(1) externally_initialized constant i8 addrspace(1)*
@@ -1496,6 +1497,18 @@
ret void
}
+; CHECK: - .args:
+; CHECK-NEXT: - .address_space: generic
+; CHECK-NEXT: .offset: 0
+; CHECK-NEXT: .size: 8
+; CHECK-NEXT: .value_kind: image
+; CHECK-NEXT: .value_type: struct
+; CHECK: .name: _Z5EmptyP13__hip_texture
+; CHECK: .symbol: _Z5EmptyP13__hip_texture.kd
+define protected amdgpu_kernel void @_Z5EmptyP13__hip_texture(%struct.__hip_texture* nocapture) local_unnamed_addr #1 {
+ ret void
+}
+
; CHECK: amdhsa.printf:
; CHECK-NEXT: - '1:1:4:%d\n'
; CHECK-NEXT: - '2:1:8:%g\n'
Index: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
@@ -104,6 +104,11 @@
if (TypeQual.find("pipe") != StringRef::npos)
return ValueKind::Pipe;
+ if (isa<PointerType>(Ty) && Ty->getPointerElementType()->isStructTy() &&
+ Ty->getPointerElementType()->getStructName() == "struct.__hip_texture") {
+ return ValueKind::Image;
+ }
+
return StringSwitch<ValueKind>(BaseTypeName)
.Case("image1d_t", ValueKind::Image)
.Case("image1d_array_t", ValueKind::Image)
@@ -541,6 +546,11 @@
if (TypeQual.find("pipe") != StringRef::npos)
return "pipe";
+ if (isa<PointerType>(Ty) && Ty->getPointerElementType()->isStructTy() &&
+ Ty->getPointerElementType()->getStructName() == "struct.__hip_texture") {
+ return "image";
+ }
+
return StringSwitch<StringRef>(BaseTypeName)
.Case("image1d_t", "image")
.Case("image1d_array_t", "image")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63850.207799.patch
Type: text/x-patch
Size: 3487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190703/cca52531/attachment.bin>
More information about the llvm-commits
mailing list