[llvm] [AMDGPU] Add `.amdgpu.info` section for per-function metadata (PR #192384)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat May 9 10:35:25 PDT 2026


================
@@ -537,6 +538,133 @@ 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);
+  // Zero-sized non-void types (e.g. `{}` or `[0 x i8]`) would collapse to the
+  // same encoding as i32, which would silently conflate distinct signatures.
+  // These aren't expected in indirect-callable signatures in practice.
+  assert(Bits > 0 && "Unexpected zero-sized non-void type in type-ID "
+                     "encoding; encoding would be ambiguous");
+  if (Bits <= 32)
----------------
arsenm wrote:

We probably ought to adjust this for the true16 case 

https://github.com/llvm/llvm-project/pull/192384


More information about the llvm-commits mailing list