[PATCH] D76524: IfOP - Add a builder with result operands
Nagy Mostafa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 20 16:18:08 PDT 2020
nmostafa updated this revision to Diff 251793.
nmostafa added a comment.
Review fixes.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76524/new/
https://reviews.llvm.org/D76524
Files:
mlir/include/mlir/Dialect/LoopOps/LoopOps.td
mlir/lib/Dialect/LoopOps/LoopOps.cpp
Index: mlir/lib/Dialect/LoopOps/LoopOps.cpp
===================================================================
--- mlir/lib/Dialect/LoopOps/LoopOps.cpp
+++ mlir/lib/Dialect/LoopOps/LoopOps.cpp
@@ -201,7 +201,13 @@
void IfOp::build(Builder *builder, OperationState &result, Value cond,
bool withElseRegion) {
+ build(builder, result, /*resultTypes=*/llvm::None, cond, withElseRegion);
+}
+
+void IfOp::build(Builder *builder, OperationState &result,
+ TypeRange resultTypes, Value cond, bool withElseRegion) {
result.addOperands(cond);
+ result.addTypes(resultTypes);
Region *thenRegion = result.addRegion();
Region *elseRegion = result.addRegion();
IfOp::ensureTerminator(*thenRegion, *builder, result.location);
Index: mlir/include/mlir/Dialect/LoopOps/LoopOps.td
===================================================================
--- mlir/include/mlir/Dialect/LoopOps/LoopOps.td
+++ mlir/include/mlir/Dialect/LoopOps/LoopOps.td
@@ -221,7 +221,10 @@
let skipDefaultBuilders = 1;
let builders = [
OpBuilder<"Builder *builder, OperationState &result, "
- "Value cond, bool withElseRegion">
+ "Value cond, bool withElseRegion">,
+ OpBuilder<"Builder *builder, OperationState &result, "
+ "TypeRange resultTypes, Value cond, "
+ "bool withElseRegion">
];
let extraClassDeclaration = [{
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76524.251793.patch
Type: text/x-patch
Size: 1410 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200320/170410fa/attachment.bin>
More information about the llvm-commits
mailing list