[Mlir-commits] [mlir] [MLIR][SCF] Update TestTileUsingCustomLoopOp to check `loops` param (PR #161490)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Oct 1 02:04:27 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: None (sebvince)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/161490.diff
1 Files Affected:
- (modified) mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp (+13)
``````````diff
diff --git a/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp b/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
index 326fec3ee5cf0..95dbbe8feda0e 100644
--- a/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
+++ b/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
@@ -22,7 +22,10 @@
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/OpImplementation.h"
+#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Interfaces/TilingInterface.h"
+#include "mlir/Support/LLVM.h"
+#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#define DEBUG_TYPE "test-tiling-interface"
@@ -586,6 +589,16 @@ DiagnosedSilenceableFailure transform::TestTileUsingCustomLoopOp::apply(
ArrayRef<SmallVector<OpFoldResult>> resultOffsets,
ArrayRef<SmallVector<OpFoldResult>> resultSizes,
ValueRange destinationTensors) -> LogicalResult {
+ if (loops.size() != 1) {
+ return emitOpError("loop size must be 1");
+ }
+ LoopLikeOpInterface loop = loops.front();
+ scf::ForOp *forOp = dyn_cast<scf::ForOp>(&loop);
+ if (!forOp) {
+ return emitOpError("unexpected loop type. Expecting scf::ForOp");
+ }
+ rewriter.setInsertionPointToEnd(forOp->getBody());
+
SmallVector<Value> yieldValues;
yieldValues.reserve(destinationTensors.size());
for (auto [tiledResult, offsets, sizes, destination] : llvm::zip_equal(
``````````
</details>
https://github.com/llvm/llvm-project/pull/161490
More information about the Mlir-commits
mailing list