[PATCH] D152432: [AMDGPU] Port no-hsa-graphic-shaders.ll to code object V4
Pierre van Houtryve via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 8 03:38:30 PDT 2023
Pierre-vh created this revision.
Pierre-vh added reviewers: arsenm, foad, scott.linder.
Herald added subscribers: StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Split from D146023 <https://reviews.llvm.org/D146023>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D152432
Files:
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
llvm/test/CodeGen/AMDGPU/no-hsa-graphics-shaders.ll
Index: llvm/test/CodeGen/AMDGPU/no-hsa-graphics-shaders.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/no-hsa-graphics-shaders.ll
+++ llvm/test/CodeGen/AMDGPU/no-hsa-graphics-shaders.ll
@@ -16,4 +16,4 @@
}
!llvm.module.flags = !{!0}
-!0 = !{i32 1, !"amdgpu_code_object_version", i32 200}
+!0 = !{i32 1, !"amdgpu_code_object_version", i32 400}
Index: llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
@@ -574,6 +574,10 @@
unsigned AMDGPUSubtarget::getKernArgSegmentSize(const Function &F,
Align &MaxAlign) const {
+ if (F.getCallingConv() != CallingConv::AMDGPU_KERNEL &&
+ F.getCallingConv() != CallingConv::SPIR_KERNEL)
+ return 0;
+
uint64_t ExplicitArgBytes = getExplicitKernArgSize(F, MaxAlign);
unsigned ExplicitOffset = getExplicitKernelArgOffset();
Index: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
@@ -943,12 +943,13 @@
void MetadataStreamerMsgPackV3::emitKernel(const MachineFunction &MF,
const SIProgramInfo &ProgramInfo) {
auto &Func = MF.getFunction();
+ if (Func.getCallingConv() != CallingConv::AMDGPU_KERNEL &&
+ Func.getCallingConv() != CallingConv::SPIR_KERNEL)
+ return;
+
auto CodeObjectVersion = AMDGPU::getCodeObjectVersion(*Func.getParent());
auto Kern = getHSAKernelProps(MF, ProgramInfo, CodeObjectVersion);
- assert(Func.getCallingConv() == CallingConv::AMDGPU_KERNEL ||
- Func.getCallingConv() == CallingConv::SPIR_KERNEL);
-
auto Kernels =
getRootMetadata("amdhsa.kernels").getArray(/*Convert=*/true);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152432.529546.patch
Type: text/x-patch
Size: 1988 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230608/148ebbd6/attachment.bin>
More information about the llvm-commits
mailing list