-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[mlir][scf] Modify the return logic of generateLoopNestUsingForOp (NFC) #159394
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
[mlir][scf] Modify the return logic of generateLoopNestUsingForOp (NFC) #159394
Conversation
@llvm/pr-subscribers-mlir-linalg @llvm/pr-subscribers-mlir-scf Author: lonely eagle (linuxlonelyeagle) ChangesWhen loops is empty, avoid executing yieldTiledValuesFn. Full diff: https://github.com/llvm/llvm-project/pull/159394.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index 834c02126fa53..f24310ecd7beb 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -455,6 +455,8 @@ static LogicalResult generateLoopNestUsingForOp(
rewriter.setInsertionPointToEnd(loop.getBody());
destinationTensors = loop.getRegionIterArgs();
}
+ if (loops.empty())
+ return success();
SmallVector<Value> tiledResults;
SmallVector<SmallVector<OpFoldResult>> resultOffsets, resultSizes;
@@ -463,9 +465,6 @@ static LogicalResult generateLoopNestUsingForOp(
return rewriter.notifyMatchFailure(
loc, "failed to generate inner tile loop body");
}
- if (loops.empty())
- return success();
-
assert(tiledResults.size() == destinationTensors.size() &&
"Number of results of body should be equal to number of iter args");
|
@llvm/pr-subscribers-mlir Author: lonely eagle (linuxlonelyeagle) ChangesWhen loops is empty, avoid executing yieldTiledValuesFn. Full diff: https://github.com/llvm/llvm-project/pull/159394.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index 834c02126fa53..f24310ecd7beb 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -455,6 +455,8 @@ static LogicalResult generateLoopNestUsingForOp(
rewriter.setInsertionPointToEnd(loop.getBody());
destinationTensors = loop.getRegionIterArgs();
}
+ if (loops.empty())
+ return success();
SmallVector<Value> tiledResults;
SmallVector<SmallVector<OpFoldResult>> resultOffsets, resultSizes;
@@ -463,9 +465,6 @@ static LogicalResult generateLoopNestUsingForOp(
return rewriter.notifyMatchFailure(
loc, "failed to generate inner tile loop body");
}
- if (loops.empty())
- return success();
-
assert(tiledResults.size() == destinationTensors.size() &&
"Number of results of body should be equal to number of iter args");
|
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! As far as I remember the logic though, since we previously check that the tile sizes are not all 0 (which leads to no loops), this shouldnt happen here. But no harm.
Could you add a test for this?
@MaheshRavishankar ping for review.Thank you. |
@MaheshRavishankar Thank you. I remember you answered my question a year or two ago. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/129/builds/30041 Here is the relevant piece of the build log for the reference
|
…C) (llvm#159394) When loops is empty, avoid executing yieldTiledValuesFn and Add a test which all tile sizes are set to zero.
When loops is empty, avoid executing yieldTiledValuesFn and Add a test which all tile sizes are set to zero.