Update MemRefAccess::getAccessMap to always canonicalize map + operands

- with this we won't see duplicate / unused operands when getting access maps,
  or when constructing FlatAffineConstraints based on such maps

- we can probably change fullyComposeAffineMapAndOperands to ensure this
  TODO(b/123879896).

PiperOrigin-RevId: 232356600
This commit is contained in:
Uday Bondhugula 2019-02-04 13:33:51 -08:00 committed by jpienaar
parent 74adaa5b31
commit 99d6ee02b9
1 changed files with 1 additions and 0 deletions

View File

@ -1179,6 +1179,7 @@ void MemRefAccess::getAccessMap(AffineValueMap *accessMap) const {
memref->getType().getContext()); memref->getType().getContext());
SmallVector<Value *, 8> operands(indices.begin(), indices.end()); SmallVector<Value *, 8> operands(indices.begin(), indices.end());
fullyComposeAffineMapAndOperands(&map, &operands); fullyComposeAffineMapAndOperands(&map, &operands);
canonicalizeMapAndOperands(&map, &operands);
accessMap->reset(map, operands); accessMap->reset(map, operands);
} }