-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][transforms] Add signalPassFailure
in RemoveDeadValues
#112199
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 PR adds `signalPassFailure` in RemoveDeadValues to ensure that a pipeline would stop here.
@llvm/pr-subscribers-mlir Author: Longsheng Mou (CoTinker) ChangesThis PR adds Full diff: https://github.com/llvm/llvm-project/pull/112199.diff 1 Files Affected:
diff --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp
index 3de4fb75ed831c..7e45f18b660ba7 100644
--- a/mlir/lib/Transforms/RemoveDeadValues.cpp
+++ b/mlir/lib/Transforms/RemoveDeadValues.cpp
@@ -589,7 +589,7 @@ void RemoveDeadValues::runOnOperation() {
});
if (acceptableIR.wasInterrupted())
- return;
+ return signalPassFailure();
module->walk([&](Operation *op) {
if (auto funcOp = dyn_cast<FunctionOpInterface>(op)) {
|
@llvm/pr-subscribers-mlir-core Author: Longsheng Mou (CoTinker) ChangesThis PR adds Full diff: https://github.com/llvm/llvm-project/pull/112199.diff 1 Files Affected:
diff --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp
index 3de4fb75ed831c..7e45f18b660ba7 100644
--- a/mlir/lib/Transforms/RemoveDeadValues.cpp
+++ b/mlir/lib/Transforms/RemoveDeadValues.cpp
@@ -589,7 +589,7 @@ void RemoveDeadValues::runOnOperation() {
});
if (acceptableIR.wasInterrupted())
- return;
+ return signalPassFailure();
module->walk([&](Operation *op) {
if (auto funcOp = dyn_cast<FunctionOpInterface>(op)) {
|
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.
Could you add a test here please?
I don't know how to add test for signalPassFailure, could you please give me some advice. |
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.
You can add a test with // expected-error
and use --verify-diagnostics
(I think).
LG with a test |
Mmmmm there is already a test for the diagnostic, somehow the test does not check the return of mlir-opt though! |
Sorry, I'm still having trouble understanding how to check for |
Emit an error message before the |
llvm-project/mlir/test/Transforms/remove-dead-values.mlir Lines 3 to 12 in 57d109c
It has already been checked. |
Error message is here. llvm-project/mlir/lib/Transforms/RemoveDeadValues.cpp Lines 578 to 592 in 57d109c
|
Thanks for your review. |
This PR adds
signalPassFailure
in RemoveDeadValues to ensure that a pipeline would stop here.Fixes #111757.