[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 16:50:22 PDT 2026
================
@@ -537,6 +538,149 @@ void AMDGPUAsmPrinter::validateMCResourceInfo(Function &F) {
}
}
+static void appendTypeEncoding(std::string &Enc, Type *Ty,
+ const DataLayout &DL) {
+ if (Ty->isVoidTy()) {
+ Enc += 'v';
+ return;
+ }
+ unsigned Bits = DL.getTypeSizeInBits(Ty);
+ if (Bits <= 32)
+ Enc += 'i';
+ else if (Bits <= 64)
+ Enc += 'l';
+ else
+ Enc.append(divideCeil(Bits, 32), 'i');
+}
+
+static std::string computeTypeId(const FunctionType *FTy,
----------------
shiltian wrote:
Yes. This encoding scheme is sufficient for the purpose of checking potential callees. We had some internal discussion, and then decided to use ABI type for the encoding.
The linker simply compares the indirect call type ID with function's type ID, and if they match, the function can be a potential callee of an indirect call.
https://github.com/llvm/llvm-project/pull/192384
More information about the llvm-branch-commits
mailing list