aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorMatthias Springer <springerm@google.com>2021-08-17 10:08:08 +0900
committerMatthias Springer <springerm@google.com>2021-08-17 10:09:17 +0900
commit4c4ab673f10f558fa55ec97ece95ddfe109b2212 (patch)
tree6107d740fe32a8dfcc4894c95537f7c0855a9003 /mlir/lib/Transforms/Utils/LoopUtils.cpp
parentf27fee623d0124c64a73374d0256819396647864 (diff)
downloadllvm-4c4ab673f10f558fa55ec97ece95ddfe109b2212.zip
llvm-4c4ab673f10f558fa55ec97ece95ddfe109b2212.tar.gz
llvm-4c4ab673f10f558fa55ec97ece95ddfe109b2212.tar.bz2
[mlir][Analysis][NFC] Split FlatAffineConstraints class
* Extract "value" functionality of `FlatAffineConstraints` into a new derived `FlatAffineValueConstraints` class. Current users of `FlatAffineConstraints` can use `FlatAffineValueConstraints` without additional code changes, thus NFC. * `FlatAffineConstraints` no longer associates dimensions with SSA Values. All functionality that requires this, is moved to `FlatAffineValueConstraints`. * `FlatAffineConstraints` no longer makes assumptions about where Values associated with dimensions are coming from. Differential Revision: https://reviews.llvm.org/D107725
Diffstat (limited to 'mlir/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--mlir/lib/Transforms/Utils/LoopUtils.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp
index 15aea84..fcca1ae 100644
--- a/mlir/lib/Transforms/Utils/LoopUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp
@@ -459,7 +459,7 @@ checkTilingLegalityImpl(MutableArrayRef<mlir::AffineForOp> origLoops) {
unsigned numOps = loadAndStoreOps.size();
unsigned numLoops = origLoops.size();
- FlatAffineConstraints dependenceConstraints;
+ FlatAffineValueConstraints dependenceConstraints;
for (unsigned d = 1; d <= numLoops + 1; ++d) {
for (unsigned i = 0; i < numOps; ++i) {
Operation *srcOp = loadAndStoreOps[i];
@@ -596,7 +596,7 @@ void constructTiledLoopNest(MutableArrayRef<AffineForOp> origLoops,
LogicalResult checkIfHyperRectangular(MutableArrayRef<AffineForOp> input,
AffineForOp rootAffineForOp,
unsigned width) {
- FlatAffineConstraints cst;
+ FlatAffineValueConstraints cst;
SmallVector<Operation *, 8> ops(input.begin(), input.end());
(void)getIndexSet(ops, &cst);
if (!cst.isHyperRectangular(0, width)) {
@@ -2440,7 +2440,7 @@ static LogicalResult generateCopy(
for (unsigned i = 0; i < rank; ++i)
region.getLowerAndUpperBound(i, lbMaps[i], ubMaps[i]);
- const FlatAffineConstraints *cst = region.getConstraints();
+ const FlatAffineValueConstraints *cst = region.getConstraints();
// 'regionSymbols' hold values that this memory region is symbolic/parametric
// on; these typically include loop IVs surrounding the level at which the
// copy generation is being done or other valid symbols in MLIR.
@@ -3001,7 +3001,7 @@ static AffineIfOp createSeparationCondition(MutableArrayRef<AffineForOp> loops,
auto *context = loops[0].getContext();
- FlatAffineConstraints cst;
+ FlatAffineValueConstraints cst;
SmallVector<Operation *, 8> ops;
ops.reserve(loops.size());
for (AffineForOp forOp : loops)
@@ -3082,7 +3082,7 @@ createFullTiles(MutableArrayRef<AffineForOp> inputNest,
// For each loop in the original nest identify a lower/upper bound pair such
// that their difference is a constant.
- FlatAffineConstraints cst;
+ FlatAffineValueConstraints cst;
for (auto loop : inputNest) {
// TODO: straightforward to generalize to a non-unit stride.
if (loop.getStep() != 1) {