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 = [{ 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);