[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
Fri Apr 17 14:00:11 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. I actually had a version that used pretty similar approach as the existing TypeID based approach, but after some discussion, we think it would be better to have some tolerance here, which is to allow ABI-level compatible. IIUC C++ also allows the cast between "compatible" function type.
https://github.com/llvm/llvm-project/pull/192384
More information about the llvm-branch-commits
mailing list