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

Rolf Morel llvmlistbot at llvm.org
Mon Oct 6 06:35:49 PDT 2025


================
@@ -665,24 +759,69 @@ 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();
+  ArrayRef<int64_t> permutation = getStaticTileInterchange();
+  if (!llvm::any_of(permutation,
+                    [](int64_t v) { return ShapedType::isDynamic(v); })) {
----------------
rolfmorel wrote:

Interesting - didn't know about the interchange on just the outer loops.

The checks you list sound right 👍 

It does have me thinking again: what does interchange do when loop type is forall? Per the code in this PR, the forall is just a single loop (or rather just a single op). Does interchange change the order of the indices and ranges on the forall?

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


More information about the Mlir-commits mailing list