[MLIR] Fix memref get constant bound size and shape method
authorUday Bondhugula <uday@polymagelabs.com>
Mon, 28 Jun 2021 19:39:51 +0000 (01:09 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Mon, 5 Jul 2021 17:30:41 +0000 (23:00 +0530)
commit715137d0c8f99d172e06526032c8f13104af5e51
treecec96950861ce9c3fb4e77641bf56b9b0d36d80a
parentb931c2a714b93327c602ee54e867f812bded4262
[MLIR] Fix memref get constant bound size and shape method

Fix FlatAffineConstraints::getConstantBoundOnDimSize to ensure that
returned bounds on dim size are always non-negative regardless of the
constraints on that dimension. Add an assertion at the user.

Differential Revision: https://reviews.llvm.org/D105171
mlir/include/mlir/Analysis/AffineStructures.h
mlir/include/mlir/Analysis/Utils.h
mlir/lib/Analysis/AffineStructures.cpp
mlir/lib/Analysis/Utils.cpp
mlir/test/Dialect/Affine/affine-data-copy.mlir