[Mlir-commits] [mlir] 46dd827 - [mlir] Forward listeners when utilizing scf::IfOp::get*BodyBuilder.
Tres Popp
llvmlistbot at llvm.org
Fri Oct 9 09:03:12 PDT 2020
Author: Tres Popp
Date: 2020-10-09T18:03:01+02:00
New Revision: 46dd827232e73135eca1b6f05dc5bebdb277c9db
URL: https://github.com/llvm/llvm-project/commit/46dd827232e73135eca1b6f05dc5bebdb277c9db
DIFF: https://github.com/llvm/llvm-project/commit/46dd827232e73135eca1b6f05dc5bebdb277c9db.diff
LOG: [mlir] Forward listeners when utilizing scf::IfOp::get*BodyBuilder.
Without this PatternRewriting infrastructure does not know of modifications and
cannot properly legalize nor rollback changes.
Differential Revision: https://reviews.llvm.org/D89129
Added:
Modified:
mlir/include/mlir/Dialect/SCF/SCFOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/SCF/SCFOps.td b/mlir/include/mlir/Dialect/SCF/SCFOps.td
index 1011e0d7ef68..d7ff8b6352bb 100644
--- a/mlir/include/mlir/Dialect/SCF/SCFOps.td
+++ b/mlir/include/mlir/Dialect/SCF/SCFOps.td
@@ -251,15 +251,15 @@ def IfOp : SCF_Op<"if",
];
let extraClassDeclaration = [{
- OpBuilder getThenBodyBuilder() {
+ OpBuilder getThenBodyBuilder(OpBuilder::Listener *listener = nullptr) {
Block* body = getBody(0);
- return results().empty() ? OpBuilder::atBlockTerminator(body)
- : OpBuilder::atBlockEnd(body);
+ return results().empty() ? OpBuilder::atBlockTerminator(body, listener)
+ : OpBuilder::atBlockEnd(body, listener);
}
- OpBuilder getElseBodyBuilder() {
+ OpBuilder getElseBodyBuilder(OpBuilder::Listener *listener = nullptr) {
Block* body = getBody(1);
- return results().empty() ? OpBuilder::atBlockTerminator(body)
- : OpBuilder::atBlockEnd(body);
+ return results().empty() ? OpBuilder::atBlockTerminator(body, listener)
+ : OpBuilder::atBlockEnd(body, listener);
}
}];
}
More information about the Mlir-commits
mailing list