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

Mehdi Amini llvmlistbot at llvm.org
Tue May 12 04:15:46 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:

> Yet, we are adding special verification cases to upstream interfaces to prevent misuse,

We don't need to add these checks, and I'm actually against adding these to the interfaces as this is purely dead code upstream.

> Or at the very least, is misleading calling these structural if there's no structural verification.

I disagree with your characterization: these are structural constraints, regardless of the enforcement: this is orthogonal. 


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


More information about the Mlir-commits mailing list