HomePhabricator

[mlir] Add MemRefTypeBuilder and refactor some MemRefType::get().

Authored by timshen on Jan 22 2020, 1:46 PM.

Description

[mlir] Add MemRefTypeBuilder and refactor some MemRefType::get().

The refactored MemRefType::get() calls all intend to clone from another
memref type, with some modifications. In fact, some calls dropped memory space
during the cloning. Migrate them to the cloning API so that nothing gets
dropped if they are not explicitly listed.

It's close to NFC but not quite, as it helps with propagating memory spaces in
some places.

Differential Revision: https://reviews.llvm.org/D73296

Details