[all-commits] [llvm/llvm-project] 78cefa: [AMDGPU] Add `.amdgpu.info` section for per-functi...

Shilei Tian via All-commits all-commits at lists.llvm.org
Wed Apr 15 21:03:08 PDT 2026


  Branch: refs/heads/users/shiltian/amdgpu-function-info
  Home:   https://github.com/llvm/llvm-project
  Commit: 78cefa3e18659ed33e428e4206d9e32d6f1b54c0
      https://github.com/llvm/llvm-project/commit/78cefa3e18659ed33e428e4206d9e32d6f1b54c0
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2026-04-16 (Thu, 16 Apr 2026)

  Changed paths:
    A llvm/include/llvm/Support/AMDGPUObjLinkingInfo.h
    M llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h
    M llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
    M llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    M llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
    M llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
    A llvm/test/CodeGen/AMDGPU/lds-link-time-codegen-callgraph.ll
    A llvm/test/CodeGen/AMDGPU/lds-link-time-codegen-cross-tu-addr-taken.ll
    A llvm/test/CodeGen/AMDGPU/lds-link-time-codegen-indirect.ll
    M llvm/test/CodeGen/AMDGPU/lds-link-time-codegen-named-barrier.ll
    A llvm/test/CodeGen/AMDGPU/lds-link-time-codegen-prototype.ll
    M llvm/test/CodeGen/AMDGPU/lds-link-time-codegen.ll
    A llvm/test/MC/AMDGPU/amdgpu-info-roundtrip.s

  Log Message:
  -----------
  [AMDGPU] Add `.amdgpu.info` section for per-function metadata

AMDGPU object linking requires the linker to propagate resource usage
(registers, stack, LDS) across translation units. To support this, the compiler
must emit per-function metadata and call graph edges in the relocatable object
so the linker can compute whole-program resource requirements.

This PR introduces a `.amdgpu.info` ELF section using a tagged, length-prefixed
binary format: each entry is encoded as:

```
[kind: u8] [len: u8] [payload: <len> bytes]
```

A function scope is opened by an `INFO_FUNC` entry (containing a symbol
reference), followed by per-function attributes (register counts, flags, private
segment size) and relational edges (direct calls, LDS uses, indirect call
signatures). String data such as function type signatures is stored in a
companion `.amdgpu.strtab` section.

The format is forward-compatible: a consumer that encounters an unknown kind can
skip it by reading the length byte, allowing new entry kinds to be added without
breaking existing toolchains.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list