This patch adds patterns to rewrite memory accesses such that the resulting
accesses are only using a base pointer.
E.g.,
mlir memref.load %base[%off0, ...]
Will be rewritten in:
mlir %new_base = memref.subview %base[%off0,...][1,...][1,...] memref.load %new_base[%c0,...]
The idea behind these patterns is to offer a way to more gradually lower
address computations.
These patterns are the exact opposite of FoldMemRefAliasOps.
I've implemented the support of only three operations in this patch:
- memref.load
- memref.store
- nvgpu.ldmatrix
Going forward we may want to provide an interface for these rewritings (and
the ones in FoldMemRefAliasOps.)
One step at a time!
Similary to https://reviews.llvm.org/D146624 we want all these populate to live in Transform/Transforms.h