[PATCH] D158150: [AMDGPU] Add dynamic LDS size implicit kernel argument to v5
krishna chaitanya sankisa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 17 22:06:49 PDT 2023
skc7 updated this revision to Diff 551381.
skc7 retitled this revision from "[AMDGPU] Add dynamic LDS size implicit argument to v5" to "[AMDGPU] Add dynamic LDS size implicit kernel argument to v5".
skc7 added a comment.
Update alignment for int32 type lds_size argument
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158150/new/
https://reviews.llvm.org/D158150
Files:
llvm/docs/AMDGPUUsage.rst
llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args-v5.ll
Index: llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args-v5.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args-v5.ll
+++ llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args-v5.ll
@@ -87,9 +87,12 @@
; GFX8-NEXT: - .offset: 220
; GFX8-NEXT: .size: 4
; GFX8-NEXT: .value_kind: hidden_shared_base
-; CHECK: - .offset: 224
+; CHECK: - .offset: 224
; CHECK-NEXT: .size: 8
; CHECK-NEXT: .value_kind: hidden_queue_ptr
+; CHECK: - .offset: 232
+; CHECK-NEXT: .size: 4
+; CHECK-NEXT: .value_kind: hidden_dynamic_lds_size
; CHECK: .name: test_v5
; CHECK: .symbol: test_v5.kd
Index: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
@@ -1099,6 +1099,11 @@
if (MFI.hasQueuePtr())
emitKernelArg(DL, Int8PtrTy, Align(8), "hidden_queue_ptr", Offset, Args);
+ else
+ Offset += 8; // Skipped
+
+ // emit argument for hidden dynamic lds size
+ emitKernelArg(DL, Int32Ty, Align(4), "hidden_dynamic_lds_size", Offset, Args);
}
void MetadataStreamerMsgPackV5::emitKernelAttrs(const Function &Func,
Index: llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
===================================================================
--- llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
+++ llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
@@ -138,6 +138,7 @@
.Case("hidden_private_base", true)
.Case("hidden_shared_base", true)
.Case("hidden_queue_ptr", true)
+ .Case("hidden_dynamic_lds_size", true)
.Default(false);
}))
return false;
Index: llvm/docs/AMDGPUUsage.rst
===================================================================
--- llvm/docs/AMDGPUUsage.rst
+++ llvm/docs/AMDGPUUsage.rst
@@ -3960,6 +3960,9 @@
associated dispatch AQL packet. It is only required for pre-GFX9
devices for the trap handler ABI (see :ref:`amdgpu-amdhsa-trap-handler-abi`).
+ "hidden_dynamic_lds_size"
+ Size of the dynamically allocated LDS memory is passed in the kernarg.
+
====================== ============== ========= ================================
..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158150.551381.patch
Type: text/x-patch
Size: 2800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230818/6825eae8/attachment.bin>
More information about the llvm-commits
mailing list