[llvm] [IR] Add initial support for the byte type (PR #178666)

Pedro Lobo via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 14 08:01:38 PST 2026


================
@@ -465,9 +460,9 @@ class Vocabulary {
 
   /// String mappings for CanonicalTypeID values
   static constexpr StringLiteral CanonicalTypeNames[] = {
-      "FloatTy",   "VoidTy",   "LabelTy",   "MetadataTy",
-      "VectorTy",  "TokenTy",  "IntegerTy", "FunctionTy",
-      "PointerTy", "StructTy", "ArrayTy",   "UnknownTy"};
+      "FloatTy",  "VoidTy",    "LabelTy",  "MetadataTy", "VectorTy",
----------------
pedroclobo wrote:

I believe these follow (and should follow) the same order as defined in [`llvm/IR/Type.h`](https://github.com/llvm/llvm-project/blob/1ee03d1e097f05cc9811a0e4a3e7e13e35340b6d/llvm/include/llvm/IR/Type.h#L54C1-L80C1) (see [this comment](https://github.com/llvm/llvm-project/blob/1ee03d1e097f05cc9811a0e4a3e7e13e35340b6d/llvm/include/llvm/Analysis/IR2Vec.h#L482-L483) in `IR2Vec.h`). There, the first group of types are primitive types and the following ones are derived types. We could change all tree (`Type.h`, `TypeIDMapping`, and `CanonicalTypeNames`) to follow alphabetical order. However, the existing distinction between primitive and derived types seems to make sense. Also, the most common derived types are listed first (integer, byte, function, pointer, ...)

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


More information about the llvm-commits mailing list