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

Matthias Springer llvmlistbot at llvm.org
Sun May 24 07:36:27 PDT 2026


================
@@ -740,6 +740,14 @@ The [builtin dialect](Dialects/Builtin.md) defines a set of types that are
 directly usable by any other dialect in MLIR. These types cover a range from
 primitive integer and floating-point types, function types, and more.
 
+A *token* is an SSA value of the builtin parameterless, opaque `token` type.
+It carries no runtime data. Intuitively, a token is a pointer to an operation
+(via its result) or to a region (via an entry block argument). Unlike regular
+SSA values, a token cannot be forwarded: its def-use chain cannot be obscured
+by ops with forwarding semantics such as `arith.select` or `cf.br`, so you can
+always walk back from any use of a token to *the* specific operation or region
+that produced it. See [Tokens](Tokens.md) for more details.
----------------
matthias-springer wrote:

I moved the structural control to the LangRef section. I kept one example for the first item (`A token must not appear as a forwarded value.`) and moved the remaining list of examples to the "Examples" section in `Tokens.md`.


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


More information about the Mlir-commits mailing list