[Mlir-commits] [mlir] [mlir][LLVM] Add the `byte` type to the LLVM dialect (PR #203795)
Fabian Mora
llvmlistbot at llvm.org
Mon Jun 15 04:39:04 PDT 2026
Markus =?utf-8?q?Böck?= <markus.boeck02 at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/203795 at github.com>
================
@@ -60,6 +60,31 @@ def LLVMArrayType : LLVMType<"LLVMArray", "array", [
}];
}
+//===----------------------------------------------------------------------===//
+// LLVMByteType
+//===----------------------------------------------------------------------===//
+
+def LLVMByteType : LLVMType<"LLVMByte", "byte", [
+ DeclareTypeInterfaceMethods<DataLayoutTypeInterface,
+ ["getTypeSizeInBits", "getABIAlignment"]>,
+ VectorElementTypeInterface]> {
+ let summary = "LLVM byte type";
+ let description = [{
+ The ``!llvm.byte` type represents raw memory data in SSA registers, mirroring
+ LLVM's builtin byte type.
+ It should be used when it cannot be determined whether a value holds a
+ pointer or another type at run time, or if the value contains uninitialized
+ or poison data.
+ Unlike integer types, copying byte types preserves all poison bits and the
+ provenance of pointers.
+ }];
+
+ let parameters = (ins "unsigned":$bitWidth);
----------------
fabianmcg wrote:
Per the lang ref, the width can be `Any bit width from 1 bit to 2^23(about 8 million) can be specified.`
https://github.com/llvm/llvm-project/pull/203795
More information about the Mlir-commits
mailing list