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

Jacques Pienaar llvmlistbot at llvm.org
Tue Jun 2 22:08:00 PDT 2026


================
@@ -165,8 +165,24 @@ class SameBuildabilityAs<Type type, code builder> {
   code builderCall = !if(!empty(type.builderCall), "", builder);
 }
 
-// Any type at all.
-def AnyType : Type<CPred<"true">, "any type">;
+// Whether a type is the builtin `TokenType`.
+def IsTokenTypePred : CPred<"::llvm::isa<::mlir::TokenType>($_self)">;
----------------
jpienaar wrote:

I don't see that as implicit: the user changed the op to opt-in to an "extended" type system. For non-token consuming/producing ops (either by argument, result or trait) token is not part of their type system and rejected. If you opt-in for the op to use the extended type system that includes token, then yes anytype means any type in that type system. 

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


More information about the Mlir-commits mailing list