[llvm] [AMDGPU] Erase ShaderFunctions in AMDGPUPALMetadata::reset() (PR #65247)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 00:03:57 PDT 2023


https://github.com/tywuAMD created https://github.com/llvm/llvm-project/pull/65247:

**Issue**
Before this pull request, ShaderFunctions was never get erased when the pal metadata were reset. As a result, when the same ELF streamer was reused for another compilation, the ShaderFunctions was dirty so that the .Shader_Function section could not be generated properly.

**Fix**
Erase ShaderFunctions in AMDGPUPALMetadata::reset()

>From c5256ed192d21487fb529c1131a5e31b4c6939b3 Mon Sep 17 00:00:00 2001
From: Tianyuan <tianyuwu at amd.com>
Date: Mon, 4 Sep 2023 14:00:22 +0800
Subject: [PATCH] AMDGPU: Reset ShaderFunctions

---
 llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp
index 91bb8ea002c7b0..58a26e1a2d549f 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp
@@ -908,6 +908,7 @@ void AMDGPUPALMetadata::reset() {
   MsgPackDoc.clear();
   Registers = MsgPackDoc.getEmptyNode();
   HwStages = MsgPackDoc.getEmptyNode();
+  ShaderFunctions = MsgPackDoc.getEmptyNode();
 }
 
 unsigned AMDGPUPALMetadata::getPALVersion(unsigned idx) {



More information about the llvm-commits mailing list