[MLIR][SCF] Update TestTileUsingCustomLoopOp to check loops param#161490
Open
sebvince wants to merge 2 commits into
Open
[MLIR][SCF] Update TestTileUsingCustomLoopOp to check loops param#161490sebvince wants to merge 2 commits into
loops param#161490sebvince wants to merge 2 commits into
Conversation
loops param
befc959 to
fd3c232
Compare
Member
|
@llvm/pr-subscribers-mlir Author: None (sebvince) ChangesFull diff: https://github.com/llvm/llvm-project/pull/161490.diff 1 Files Affected:
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(
|
joker-eph
reviewed
Oct 1, 2025
joker-eph
reviewed
Oct 1, 2025
| if (!forOp) { | ||
| return emitOpError("unexpected loop type. Expecting scf::ForOp"); | ||
| } | ||
| rewriter.setInsertionPointToEnd(forOp->getBody()); |
Contributor
There was a problem hiding this comment.
Why is this changing nothing to the rest of the test?
Contributor
Author
There was a problem hiding this comment.
This test needs the insertionPoint to be set at the end of getBody of the loop. Previously, it was implicitly set in generateLoopHeaderFn.
…ansformOps.cpp Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.