HomePhabricator

Extend map canonicalization to propagate constant operands

Authored by bondhugula on Aug 29 2019, 1:13 AM.

Description

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

Event Timeline

A. Unique TensorFlower <gardener@tensorflow.org> committed rG4bb6f8ecdb54: Extend map canonicalization to propagate constant operands (authored by bondhugula).Aug 29 2019, 1:13 AM