[Mlir-commits] [mlir] [MLIR][Transform] FuseOp: accept transform params, add use_forall argument (PR #161883)

Rolf Morel llvmlistbot at llvm.org
Tue Oct 7 12:28:44 PDT 2025


================
@@ -665,24 +759,51 @@ transform::FuseOp::apply(transform::TransformRewriter &rewriter,
 }
 
 LogicalResult transform::FuseOp::verify() {
-  SmallVector<int64_t> permutation =
-      extractFromIntegerArrayAttr<int64_t>(getTileInterchange());
-  auto sequence = llvm::to_vector(llvm::seq<int64_t>(0, permutation.size()));
-  if (!std::is_permutation(sequence.begin(), sequence.end(),
-                           permutation.begin(), permutation.end())) {
-    return emitOpError() << "expects interchange to be a permutation, found "
-                         << getTileInterchange();
+  auto iterspace_dim = getStaticTileSizes().size();
+  ArrayRef<int64_t> permutation = getStaticTileInterchange();
+  if (permutation.size() > iterspace_dim)
+    return emitOpError()
+           << "interchange length exceeds iteration space dimensions ("
+           << iterspace_dim << "), found " << getTileInterchange();
+  llvm::SmallDenseSet<int64_t, 4> seen;
----------------
rolfmorel wrote:

Nit: rather than a hash set, this could be a SmallVector of bools (or even a I64BitSet as "64 dims ought to be enough for everyone").

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


More information about the Mlir-commits mailing list