summaryrefslogtreecommitdiff
path: root/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
diff options
context:
space:
mode:
authorFrederik Gossen <frgossen@google.com>2023-01-20 10:51:16 -0500
committerFrederik Gossen <frgossen@google.com>2023-01-20 10:52:08 -0500
commit1125c5c0b2cf13aa112a7531eb89fd1b771aa13b (patch)
tree5d1a6d5fa9b9a73ff59c6e2779e609f093ca5b02 /mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
parente6241cbdcbf3cc9beb49460578466e18936ef220 (diff)
[MLIR] Remove scf.if builder with explicit result types and callbacks
Instead, use the builder and infer the return type based on the inner `yield` ops. Also, fix uses that do not create the terminator as required for the callback builders. Differential Revision: https://reviews.llvm.org/D142056
Diffstat (limited to 'mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp')
-rw-r--r--mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp b/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
index 4e746ea561cb..16cbfca3f3e2 100644
--- a/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
+++ b/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
@@ -92,7 +92,7 @@ Value getBroadcastedDim(ImplicitLocOpBuilder lb, ValueRange extentTensors,
Type indexTy = lb.getIndexType();
broadcastedDim =
lb.create<IfOp>(
- TypeRange{indexTy}, outOfBounds,
+ outOfBounds,
[&](OpBuilder &b, Location loc) {
b.create<scf::YieldOp>(loc, broadcastedDim);
},
@@ -293,7 +293,7 @@ LogicalResult IsBroadcastableOpConverter::matchAndRewrite(
loc, arith::CmpIPredicate::ult, iv, rankDiff);
broadcastable =
b.create<IfOp>(
- loc, TypeRange{i1Ty}, outOfBounds,
+ loc, outOfBounds,
[&](OpBuilder &b, Location loc) {
// Non existent dimensions are always broadcastable
b.create<scf::YieldOp>(loc, broadcastable);
@@ -522,7 +522,7 @@ ShapeEqOpConverter::matchAndRewrite(ShapeEqOp op, OpAdaptor adaptor,
Value eqRank = rewriter.create<arith::CmpIOp>(loc, arith::CmpIPredicate::eq,
firstRank, rank);
auto same = rewriter.create<IfOp>(
- loc, i1Ty, eqRank,
+ loc, eqRank,
[&](OpBuilder &b, Location loc) {
Value one = b.create<arith::ConstantIndexOp>(loc, 1);
Value init =