From ba6fdc8b01403d0c83454019c81a38b84966fe9a Mon Sep 17 00:00:00 2001 From: River Riddle Date: Wed, 6 Mar 2019 17:37:14 -0800 Subject: Move UtilResult into the Support directory and rename it to Status. Status provides an unambiguous way to specify success/failure results. These can be generated by 'Status::success()' and Status::failure()'. Status provides no implicit conversion to bool and should be consumed by one of the following utility functions: * bool succeeded(Status) - Return if the status corresponds to a success value. * bool failed(Status) - Return if the status corresponds to a failure value. PiperOrigin-RevId: 237153884 --- mlir/lib/Transforms/LoopTiling.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mlir/lib/Transforms/LoopTiling.cpp') diff --git a/mlir/lib/Transforms/LoopTiling.cpp b/mlir/lib/Transforms/LoopTiling.cpp index e58de3bc136..7e345bf15fe 100644 --- a/mlir/lib/Transforms/LoopTiling.cpp +++ b/mlir/lib/Transforms/LoopTiling.cpp @@ -151,8 +151,8 @@ static void constructTiledIndexSetHyperRect( /// Tiles the specified band of perfectly nested loops creating tile-space loops /// and intra-tile loops. A band is a contiguous set of loops. // TODO(bondhugula): handle non hyper-rectangular spaces. -UtilResult mlir::tileCodeGen(MutableArrayRef> band, - ArrayRef tileSizes) { +Status mlir::tileCodeGen(MutableArrayRef> band, + ArrayRef tileSizes) { assert(!band.empty()); assert(band.size() == tileSizes.size() && "Incorrect number of tile sizes"); @@ -215,7 +215,7 @@ UtilResult mlir::tileCodeGen(MutableArrayRef> band, if (!cst.isHyperRectangular(0, width)) { rootAffineForOp->emitError("tiled code generation unimplemented for the" "non-hyperrectangular case"); - return UtilResult::Failure; + return Status::failure(); } constructTiledIndexSetHyperRect(origLoops, newLoops, tileSizes); @@ -227,7 +227,7 @@ UtilResult mlir::tileCodeGen(MutableArrayRef> band, // Erase the old loop nest. rootAffineForOp->erase(); - return UtilResult::Success; + return Status::success(); } // Identify valid and profitable bands of loops to tile. This is currently just @@ -265,7 +265,7 @@ void LoopTiling::runOnFunction() { clTileSizes.begin() + std::min(clTileSizes.size(), band.size()), tileSizes.begin()); - if (tileCodeGen(band, tileSizes)) + if (failed(tileCodeGen(band, tileSizes))) return signalPassFailure(); } } -- cgit v1.2.3