[llvm-branch-commits] [llvm] [AMDGPU] Add `.amdgpu.info` section for per-function metadata (PR #192384)
Shilei Tian via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Apr 16 06:38:48 PDT 2026
================
@@ -0,0 +1,53 @@
+//===--- AMDGPUObjLinkingInfo.h ---------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file
+/// Enums shared between the AMDGPU backend (LLVM) and the ELF linker (LLD)
+/// for the `.amdgpu.info` object-linking metadata section.
+///
+/// Binary layout of each entry: [kind: u8] [len: u8] [payload: <len> bytes].
+/// Unknown kinds are forward-compatible: a consumer skips them by reading len.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_AMDGPUOBJECTLINKINGINFO_H
+#define LLVM_SUPPORT_AMDGPUOBJECTLINKINGINFO_H
+
+#include <cstdint>
+
+namespace llvm {
+namespace AMDGPU {
+
+/// Entry kind values for the `.amdgpu.info` section.
+enum InfoKind : uint8_t {
+ INFO_FUNC = 1, // [symbol_ref: 8B] — opens function scope
+ INFO_NUM_VGPR = 2, // [u32]
+ INFO_NUM_AGPR = 3, // [u32]
+ INFO_NUM_SGPR = 4, // [u32]
+ INFO_NUM_NAMED_BARRIER = 5, // [u32]
+ INFO_PRIVATE_SEGMENT_SIZE = 6, // [u32]
+ INFO_OCCUPANCY_LDS_LIMIT = 7, // [u32]
+ INFO_FLAGS = 8, // [u32] — FuncInfoFlags bitfield
+ INFO_USE = 9, // [dst_symbol: 8B]
+ INFO_CALL = 10, // [dst_symbol: 8B]
+ INFO_INDIRECT_CALL = 11, // [strtab_offset: u32]
----------------
shiltian wrote:
`USE` is for associating functions with their LDS variables and named barriers.
https://github.com/llvm/llvm-project/pull/192384
More information about the llvm-branch-commits
mailing list