[Mlir-commits] [mlir] [mlir][IR] Add builtin `TokenType` (PR #195640)

Mehdi Amini llvmlistbot at llvm.org
Tue May 12 01:55:13 PDT 2026


================
@@ -1237,6 +1237,26 @@ def Builtin_RankedTensor : Builtin_Type<"RankedTensor", "tensor", [
   let genVerifyDecl = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// TokenType
+//===----------------------------------------------------------------------===//
+
+def Builtin_Token : Builtin_Type<"Token", "token"> {
+  let summary = "Token type";
+  let description = [{
+    Syntax:
+
+    ```
+    token-type ::= `token`
+    ```
+
+    A use of a token SSA value is a pointer to an operation (in case of an
+    OpResult) or a pointer to a region (in case of an entry block argument).
+    A token carries no runtime data and cannot be forwarded. Tokens are
+    excluded from the `AnyType` type constraint.
----------------
joker-eph wrote:

We are focused on ODS for years and C++ op definition is already "2nd class citizen".
If someone wants to write C++ ops, they are welcome but they are without safety nets, they have to write their own C++ verifier and enforce whatever constraints.

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


More information about the Mlir-commits mailing list