[mlir][SCF] Further simplify affine maps during `for-loop-canonicalization`
authorMatthias Springer <springerm@google.com>
Mon, 7 Feb 2022 17:25:55 +0000 (02:25 +0900)
committerMatthias Springer <springerm@google.com>
Mon, 7 Feb 2022 17:40:08 +0000 (02:40 +0900)
commit9aa74347d5ad34ecaa990bd19fcffe0c7fbb8256
tree742cc361fb43d25680b0c0379e1fc52db1172420
parent022011078054c133777e1c3f8ea927bdef97f1fc
[mlir][SCF] Further simplify affine maps during `for-loop-canonicalization`

* Implement `FlatAffineConstraints::getConstantBound(EQ)`.
* Inject a simpler constraint for loops that have at most 1 iteration.
* Taking into account constant EQ bounds of FlatAffineConstraint dims/symbols during canonicalization of the resulting affine map in `canonicalizeMinMaxOp`.

Differential Revision: https://reviews.llvm.org/D119153
mlir/include/mlir/Analysis/Presburger/IntegerPolyhedron.h
mlir/lib/Analysis/Presburger/IntegerPolyhedron.cpp
mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp
mlir/test/Dialect/SCF/for-loop-canonicalization.mlir