LLVM 23.0.0git
AMDGPUObjLinkingInfo.h
Go to the documentation of this file.
1//===--- AMDGPUObjLinkingInfo.h ---------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Enums shared between the AMDGPU backend (LLVM) and the ELF linker (LLD)
11/// for the `.amdgpu.info` object-linking metadata section.
12///
13/// Binary layout of each entry: [kind: u8] [len: u8] [payload: <len> bytes].
14/// Unknown kinds are forward-compatible: a consumer skips them by reading len.
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLVM_SUPPORT_AMDGPUOBJECTLINKINGINFO_H
19#define LLVM_SUPPORT_AMDGPUOBJECTLINKINGINFO_H
20
22
23#include <cstdint>
24
25namespace llvm {
26namespace AMDGPU {
27
28/// Entry kind values for the `.amdgpu.info` section.
29///
30/// Entries that appear between an INFO_FUNC and the next INFO_FUNC (or end of
31/// section) belong to the function scope opened by that INFO_FUNC.
32enum class InfoKind : uint8_t {
33 /// Opens a new function scope. Payload is an 8-byte symbol reference
34 /// (relocated) identifying the function. All subsequent entries until the
35 /// next INFO_FUNC belong to this function.
37 /// Bitfield of FuncInfoFlags properties for the function. [u32]
39 /// Number of SGPRs explicitly used by the function. [u32]
41 /// Number of architectural VGPRs used by the function. [u32]
43 /// Number of accumulator VGPRs (AGPRs) used by the function. [u32]
45 /// Private (scratch) memory size in bytes required by the function. [u32]
47 /// Dependency edge: the function uses the resource identified by the
48 /// 8-byte relocated symbol (e.g. an LDS variable or named barrier).
50 /// Direct call edge: the function calls the callee identified by the
51 /// 8-byte relocated symbol.
53 /// Indirect call edge: the function contains an indirect call whose
54 /// callee is expected to match the type-ID string at the given
55 /// `.amdgpu.strtab` offset. [u32]
57 /// Function type ID: tags an address-taken function with a type-ID
58 /// string (at the given `.amdgpu.strtab` offset) so the linker can match
59 /// it against INFO_INDIRECT_CALL entries. [u32]
61};
62
63/// Per-function flags packed into INFO_FLAGS entries.
70
71} // namespace AMDGPU
72} // namespace llvm
73
74#endif // LLVM_SUPPORT_AMDGPUOBJECTLINKINGINFO_H
FuncInfoFlags
Per-function flags packed into INFO_FLAGS entries.
InfoKind
Entry kind values for the .amdgpu.info section.
@ INFO_INDIRECT_CALL
Indirect call edge: the function contains an indirect call whose callee is expected to match the type...
@ INFO_FLAGS
Bitfield of FuncInfoFlags properties for the function. [u32].
@ INFO_FUNC
Opens a new function scope.
@ INFO_NUM_SGPR
Number of SGPRs explicitly used by the function. [u32].
@ INFO_NUM_VGPR
Number of architectural VGPRs used by the function. [u32].
@ INFO_CALL
Direct call edge: the function calls the callee identified by the 8-byte relocated symbol.
@ INFO_NUM_AGPR
Number of accumulator VGPRs (AGPRs) used by the function. [u32].
@ INFO_TYPEID
Function type ID: tags an address-taken function with a type-ID string (at the given ....
@ INFO_PRIVATE_SEGMENT_SIZE
Private (scratch) memory size in bytes required by the function. [u32].
@ INFO_USE
Dependency edge: the function uses the resource identified by the 8-byte relocated symbol (e....
This is an optimization pass for GlobalISel generic memory operations.