[Mlir-commits] [mlir] [mlir][IR] Add builtin `TokenType` (PR #195640)
Matthias Springer
llvmlistbot at llvm.org
Mon May 25 16:33:57 PDT 2026
================
@@ -136,8 +136,8 @@ def UnrealizedConversionCastOp : Builtin_Op<"unrealized_conversion_cast", [
```
}];
- let arguments = (ins Variadic<AnyType>:$inputs);
- let results = (outs Variadic<AnyType>:$outputs);
+ let arguments = (ins Variadic<AnyTypeOrToken>:$inputs);
----------------
matthias-springer wrote:
Maybe the interesting part here is this:
```
// LLVM coroutines intrinsics use `token` and `i8*` types to represent coroutine
// identifiers and handles. To define type-safe Async Runtime operations and
// build a properly typed intermediate IR during the Async to LLVM lowering we
// define a separate types for values that can be produced by LLVM intrinsics.
def Async_CoroIdType : Async_Type<"CoroId", "coro.id"> {
let summary = "switched-resume coroutine identifier";
let description = [{
`async.coro.id` is a type identifying a switched-resume coroutine.
}];
}
```
`!async.coro.id` should have the same restrictions the token type. You cannot forward it. (If you forward it, you end up with invalid LLVMIR.)
https://github.com/llvm/llvm-project/pull/195640
More information about the Mlir-commits
mailing list