[llvm] [NFC] [Docs] Document IIT encoding flow for intrinsic type signatures (PR #185453)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 12 10:47:54 PDT 2026
================
@@ -231,6 +231,38 @@ def IntrNoCreateUndefOrPoison : IntrinsicProperty;
//===----------------------------------------------------------------------===//
// IIT constants and utils
//===----------------------------------------------------------------------===//
+// IIT (Intrinsic Information Table) Encoding
+// Each intrinsic's type signature is encoded at build time (when tblgen
+// converts .td files to .inc) and decoded at runtime (when LLVM compiles IR)
+// via 3 cooperating components:
+//
+// 1. Token definitions: IIT_* records below assign a numeric code to each type
+// or type modifier. (e.g. IIT_I32 = 4, IIT_I64 = 5; see defs below)
+// TypeInfoGen<> walks each Intrinsic<> record and builds a flat byte
+// sequence 'TypeSig' of IIT_* codes: return types first, then params.
+// For example, an intrinsic returning i64 and taking (i32, i32, i8) as
+// input params gives:
+// TypeSig = [IIT_I64, IIT_I32, IIT_I32, IIT_I8, IIT_Done]
+// TypeSig = [5, 4, 4, 2, 0]
+//
+// 2. Encoding: For each intrinsic ComputeTypeSignature() in IntrinsicEmitter.cpp
----------------
jurahul wrote:
We should describe this as just an encoding optimization by "inlining" the encoding directly into the index as opposed to putting it into the long encoding table.
https://github.com/llvm/llvm-project/pull/185453
More information about the llvm-commits
mailing list