[MLIR] fix/update affine data copy utility for max/min bounds
authorUday Bondhugula <uday@polymagelabs.com>
Wed, 1 Apr 2020 06:30:26 +0000 (12:00 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Tue, 7 Apr 2020 08:25:42 +0000 (13:55 +0530)
commit70da33bf30dabf9d3c1cddc8d18094f76ff860bb
treefb22e96443279cbc124109d33f8878b879f2deb4
parentaab9e9de4d9925617bb9bc3891fa96107b615149
[MLIR] fix/update affine data copy utility for max/min bounds

Fix point-wise copy generation to work with bounds that have max/min.
Change structure of copy loop nest to use absolute loop indices and
subtracting base from the indexes of the fast buffers. Update supporting
utilities: Fix FlatAffineConstraints::getLowerAndUpperBound to look at
equalities as well and for a missing division. Update unionBoundingBox
to not discard common constraints (leads to a tighter system). Update
MemRefRegion::getConstantBoundingSizeAndShape to add memref dimension
constraints. Run removeTrivialRedundancy at the end of
MemRefRegion::compute.  Run single iteration loop promotion and
load/store canonicalization after affine data copy (in its test pass as
well).

Differential Revision: https://reviews.llvm.org/D77320
mlir/include/mlir/Analysis/AffineStructures.h
mlir/include/mlir/Analysis/Utils.h
mlir/lib/Analysis/AffineStructures.cpp
mlir/lib/Analysis/Utils.cpp
mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/test/Dialect/Affine/affine-data-copy.mlir
mlir/test/Dialect/Affine/dma-generate.mlir
mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp