Overhaul the SDBM expression kind hierarchy
authorAlex Zinenko <zinenko@google.com>
Mon, 16 Sep 2019 15:15:25 +0000 (08:15 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 16 Sep 2019 15:16:06 +0000 (08:16 -0700)
commitcb3ecb5291ad71c74cd9db7903fffc0ad4019ff1
tree9c044d72659db79d692cb091caeb4a38260288d4
parente94db619d9727ba18732158996204e782be47d5d
Overhaul the SDBM expression kind hierarchy

Swap the allowed nesting of sum and diff expressions: now a diff expression can
contain a sum expression, but only on the left hand side.  A difference of two
expressions sum must be canonicalized by grouping their constant terms in a
single expression.  This change of sturcture became possible thanks to the
introduction of the "direct" super-kind.  It is necessary to enable support of
sum expressions on the left hand side of the stripe expression.

SDBM expressions are now grouped into the following structure
- expression
  - varying
    - direct
      - sum <- (term, constant)
      - term
        - symbol
        - dimension
        - stripe <- (term, constant)
    - negation <- (direct)
    - difference <- (direct, term)
  - constant
The notation <- (...) denotes the types of subexpressions a compound
expression can combine.

PiperOrigin-RevId: 269337222
mlir/include/mlir/Dialect/SDBM/SDBMExpr.h
mlir/lib/Dialect/SDBM/SDBMExpr.cpp
mlir/lib/Dialect/SDBM/SDBMExprDetail.h
mlir/test/SDBM/sdbm-api-test.cpp
mlir/unittests/SDBM/SDBMTest.cpp