-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir] Extend tile_using_for
verifier to fix a crash
#98366
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
Conversation
This patch adds a check for the correct number of `loops` results of the `transform.structured.tile_using_for` Op to the verifier, fixing a crash. Fix llvm#98008
@llvm/pr-subscribers-mlir Author: Felix Schneider (ubfx) ChangesThis patch adds a check for the correct number of Fix #98008 Full diff: https://github.com/llvm/llvm-project/pull/98366.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
index 4eb334f8bbbfa..e53426083527a 100644
--- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
+++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
@@ -2890,6 +2890,12 @@ LogicalResult transform::TileUsingForOp::verify() {
return emitOpError("expected same number of sizes (")
<< getMixedSizes().size() << ") and scalable sizes ()"
<< getScalableSizes().size() << ")";
+ auto staticSizes = getStaticSizes();
+ unsigned numExpectedLoops = staticSizes.size() - llvm::count(staticSizes, 0);
+ if (getLoops().size() != numExpectedLoops)
+ return emitOpError("expected number of loops to tile (")
+ << numExpectedLoops << ") to match number of `loops` results ("
+ << getLoops().size() << ")";
return success();
}
|
@llvm/pr-subscribers-mlir-linalg Author: Felix Schneider (ubfx) ChangesThis patch adds a check for the correct number of Fix #98008 Full diff: https://github.com/llvm/llvm-project/pull/98366.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
index 4eb334f8bbbfa..e53426083527a 100644
--- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
+++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
@@ -2890,6 +2890,12 @@ LogicalResult transform::TileUsingForOp::verify() {
return emitOpError("expected same number of sizes (")
<< getMixedSizes().size() << ") and scalable sizes ()"
<< getScalableSizes().size() << ")";
+ auto staticSizes = getStaticSizes();
+ unsigned numExpectedLoops = staticSizes.size() - llvm::count(staticSizes, 0);
+ if (getLoops().size() != numExpectedLoops)
+ return emitOpError("expected number of loops to tile (")
+ << numExpectedLoops << ") to match number of `loops` results ("
+ << getLoops().size() << ")";
return success();
}
|
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.
Thanks!
This patch adds a check for the correct number of `loops` results of the `transform.structured.tile_using_for` Op to the verifier, fixing a crash. Fix llvm#98008
This patch adds a check for the correct number of
loops
results of thetransform.structured.tile_using_for
Op to the verifier, fixing a crash.Fix #98008