diff options
| author | Nicolas Vasilache <ntv@google.com> | 2019-01-26 10:41:17 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 15:40:08 -0700 |
| commit | 0e7a8a9027c5f5862c3c78f41c777ba2930f9b23 (patch) | |
| tree | 943c4fbf692361d86ff3a7dd1d91962a30f92d9f /mlir/lib/Transforms/Utils/LoopUtils.cpp | |
| parent | 81c7f2e2f3bf34bc45915bbb3eb44f37331aff91 (diff) | |
| download | bcm5719-llvm-0e7a8a9027c5f5862c3c78f41c777ba2930f9b23.tar.gz bcm5719-llvm-0e7a8a9027c5f5862c3c78f41c777ba2930f9b23.zip | |
Drop AffineMap::Null and IntegerSet::Null
Addresses b/122486036
This CL addresses some leftover crumbs in AffineMap and IntegerSet by removing
the Null method and cleaning up the constructors.
As the ::Null uses were tracked down, opportunities appeared to untangle some
of the Parsing logic and make it explicit where AffineMap/IntegerSet have
ambiguous syntax. Previously, ambiguous cases were hidden behind the implicit
pointer values of AffineMap* and IntegerSet* that were passed as function
parameters. Depending the values of those pointers one of 3 behaviors could
occur.
This parsing logic convolution is one of the rare cases where I would advocate
for code duplication. The more proper fix would be to make the syntax
unambiguous or to allow some lookahead.
PiperOrigin-RevId: 231058512
Diffstat (limited to 'mlir/lib/Transforms/Utils/LoopUtils.cpp')
| -rw-r--r-- | mlir/lib/Transforms/Utils/LoopUtils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp index 66e7c5975da..d41614545d2 100644 --- a/mlir/lib/Transforms/Utils/LoopUtils.cpp +++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp @@ -46,12 +46,12 @@ AffineMap mlir::getUnrolledLoopUpperBound(const ForInst &forInst, // Single result lower bound map only. if (lbMap.getNumResults() != 1) - return AffineMap::Null(); + return AffineMap(); // Sometimes, the trip count cannot be expressed as an affine expression. auto tripCount = getTripCountExpr(forInst); if (!tripCount) - return AffineMap::Null(); + return AffineMap(); AffineExpr lb(lbMap.getResult(0)); unsigned step = forInst.getStep(); @@ -72,12 +72,12 @@ AffineMap mlir::getCleanupLoopLowerBound(const ForInst &forInst, // Single result lower bound map only. if (lbMap.getNumResults() != 1) - return AffineMap::Null(); + return AffineMap(); // Sometimes the trip count cannot be expressed as an affine expression. AffineExpr tripCount(getTripCountExpr(forInst)); if (!tripCount) - return AffineMap::Null(); + return AffineMap(); AffineExpr lb(lbMap.getResult(0)); unsigned step = forInst.getStep(); |

