diff options
| author | River Riddle <riverriddle@google.com> | 2019-03-06 17:37:14 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 17:04:19 -0700 |
| commit | ba6fdc8b01403d0c83454019c81a38b84966fe9a (patch) | |
| tree | e1d055a55d368e4647bb9850c8801dae2544a644 /mlir/lib/Transforms/LoopTiling.cpp | |
| parent | 157e3cdb1946121210d1b9f52d9739a918a92e6d (diff) | |
| download | bcm5719-llvm-ba6fdc8b01403d0c83454019c81a38b84966fe9a.tar.gz bcm5719-llvm-ba6fdc8b01403d0c83454019c81a38b84966fe9a.zip | |
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
Diffstat (limited to 'mlir/lib/Transforms/LoopTiling.cpp')
| -rw-r--r-- | mlir/lib/Transforms/LoopTiling.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<OpPointer<AffineForOp>> band, - ArrayRef<unsigned> tileSizes) { +Status mlir::tileCodeGen(MutableArrayRef<OpPointer<AffineForOp>> band, + ArrayRef<unsigned> tileSizes) { assert(!band.empty()); assert(band.size() == tileSizes.size() && "Incorrect number of tile sizes"); @@ -215,7 +215,7 @@ UtilResult mlir::tileCodeGen(MutableArrayRef<OpPointer<AffineForOp>> 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<OpPointer<AffineForOp>> 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(); } } |

