-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[MLIR][SCF] Update TestTileUsingCustomLoopOp to check loops
param
#161490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
loops
param
befc959
to
fd3c232
Compare
@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(
|
mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
Outdated
Show resolved
Hide resolved
if (!forOp) { | ||
return emitOpError("unexpected loop type. Expecting scf::ForOp"); | ||
} | ||
rewriter.setInsertionPointToEnd(forOp->getBody()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this changing nothing to the rest of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
No description provided.