[Mlir-commits] [mlir] [MLIR][Transform][SMT] Allow for declarative computations in schedules (PR #160895)

Rolf Morel llvmlistbot at llvm.org
Thu Oct 9 06:27:24 PDT 2025


================
@@ -37,19 +38,111 @@ transform::smt::ConstrainParamsOp::apply(transform::TransformRewriter &rewriter,
   //       and allow for users to attach their own implementation, which would,
   //       e.g., translate the ops to SMTLIB and hand that over to the user's
   //       favourite solver. This requires changes to the dialect's verifier.
-  return emitDefiniteFailure() << "op does not have interpreted semantics yet";
+  return emitSilenceableFailure(getLoc())
+         << "op does not have interpreted semantics yet";
 }
 
 LogicalResult transform::smt::ConstrainParamsOp::verify() {
+  auto yieldTerminator =
+      llvm::dyn_cast_if_present<mlir::smt::YieldOp>(getRegion().front().back());
+  if (!yieldTerminator)
+    return emitOpError() << "expected '"
+                         << mlir::smt::YieldOp::getOperationName()
+                         << "' as terminator";
----------------
rolfmorel wrote:

(Thought to note: I can't get the code to crash on `getRegion().front().back()` when I supply an op with an empty region. There an ODS-verifier properly catches the issue: `error: 'transform.smt.constrain_params' op expects a non-empty block`.)

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


More information about the Mlir-commits mailing list