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

Jacques Pienaar llvmlistbot at llvm.org
Fri May 29 00:09:04 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:

Mmm, yes, so AnyType goes from free to check. Many would already be doing something else (e.g., IntType checking or the like). I'm trying to think of alternative but can only think of something more invasive. With isa, is it 1 extra pointer dereference as cost extra?

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


More information about the Mlir-commits mailing list