Add rewrite pattern to compose maps into affine load/stores
authorUday Bondhugula <udayb@iisc.ac.in>
Tue, 17 Sep 2019 18:49:14 +0000 (11:49 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 17 Sep 2019 18:49:45 +0000 (11:49 -0700)
commitbd7de6d4dfb82df21f36c1c331cba87a4d0118f7
tree14151448b8f4d7f45ff70043102d049aca75be24
parent62e1faa6f6bd9f49b1bb68ba01e543850ebff5d0
Add rewrite pattern to compose maps into affine load/stores

- add canonicalization pattern to compose maps into affine loads/stores;
  templatize the pattern and reuse it for affine.apply as well

- rename getIndices -> getMapOperands() (getIndices is confusing since
  these are no longer the indices themselves but operands to the map
  whose results are the indices). This also makes the accessor uniform
  across affine.apply/load/store. Change arg names on the affine
  load/store builder to avoid confusion. Drop an unused confusing build
  method on AffineStoreOp.

- update incomplete doc comment for canonicalizeMapAndOperands (this was
  missed from a previous update).

Addresses issue tensorflow/mlir#121

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#122

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/122 from bondhugula:compose-load-store e71de1771e56a85c4282c10cb43f30cef0701c4f
PiperOrigin-RevId: 269619540
mlir/include/mlir/Dialect/AffineOps/AffineOps.h
mlir/lib/Analysis/LoopAnalysis.cpp
mlir/lib/Analysis/Utils.cpp
mlir/lib/Dialect/AffineOps/AffineOps.cpp
mlir/lib/Transforms/LowerAffine.cpp
mlir/lib/Transforms/Vectorize.cpp
mlir/test/AffineOps/canonicalize.mlir
mlir/test/Transforms/canonicalize.mlir