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

Matthias Springer llvmlistbot at llvm.org
Mon Jun 1 03:13:19 PDT 2026


================
@@ -109,6 +119,77 @@ static bool mayBeValidWithoutTerminator(Block *block) {
   return !op || op->mightHaveTrait<OpTrait::NoTerminator>();
 }
 
+LogicalResult OperationVerifier::verifyTokenValue(
+    Operation &producer, Value value,
+    function_ref<InFlightDiagnostic()> emitProducerError) {
+  if (value.getType() != tokenType)
+    return success();
+
+  if (!producer.mightHaveTrait<OpTrait::TokenProducerTrait>())
+    return emitProducerError();
+
+  for (OpOperand &use : value.getUses()) {
----------------
matthias-springer wrote:

This loop must iterate over uses. Otherwise, you cannot print the operand number as part of the error message.

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


More information about the Mlir-commits mailing list