Extend map canonicalization to propagate constant operands
authorUday Bondhugula <udayb@iisc.ac.in>
Thu, 29 Aug 2019 08:13:01 +0000 (01:13 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 29 Aug 2019 08:13:29 +0000 (01:13 -0700)
commit4bb6f8ecdb54f4ee096d8f92603d628d0cac4ed6
tree5dd16fe77e3a94b10aad09d5e08c43fc0c1eae4d
parentbc2a543225abdd3876ae0b31fac89a3b31872d86
Extend map canonicalization to propagate constant operands

- extend canonicalizeMapAndOperands to propagate constant operands into
  the map's expressions (and thus drop those operands).
- canonicalizeMapAndOperands previously only dropped duplicate and
  unused operands; however, operands that were constants were
  retained.

This change makes IR maps/expressions generated by various
utilities/passes even simpler; also makes some of the test checks more
accurate and simpler -- for eg., 0' instead of symbol(%{{.*}}).

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/107 from bondhugula:canonicalize-maps c889a51486d14fbf7db489f224f881e7e1ff7d72
PiperOrigin-RevId: 266085289
mlir/examples/Linalg/Linalg4/Example.cpp
mlir/lib/Dialect/AffineOps/AffineOps.cpp
mlir/test/AffineOps/canonicalize.mlir
mlir/test/EDSC/builder-api-test.cpp
mlir/test/Linalg/tile_conv.mlir
mlir/test/Transforms/dma-generate.mlir
mlir/test/Transforms/loop-fusion-slice-computation.mlir
mlir/test/Transforms/loop-fusion.mlir
mlir/test/Transforms/pipeline-data-transfer.mlir