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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 08:00:37 PST 2026


================
@@ -475,6 +501,17 @@ class Type {
   LLVM_ABI static Type *getFloatingPointTy(LLVMContext &C,
                                            const fltSemantics &S);
 
+  //===--------------------------------------------------------------------===//
+  // Convenience methods for getting byte/integer types.
+  //
+  /// Returns an integer (vector of integer) type with the same size of a byte
+  /// of the given byte (vector of byte) type.
+  LLVM_ABI static Type *getIntByteType(Type *);
+
+  /// Returns a byte (vector of byte) type with the same size of an integer of
+  /// the given integer (vector of integer) type.
+  LLVM_ABI static Type *getByteIntType(Type *);
----------------
nikic wrote:

FWIW, I find these method names not super intuitive in that it's not really obvious which of these takes an int and return a byte and which does it the other way around...

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


More information about the llvm-commits mailing list