[mlir][MemRef] Add patterns to extract address computations
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 five operations in this patch: - memref.load - memref.store - nvgpu.ldmatrix - vector.transfer_read - vector.transfer_write Going forward we may want to provide an interface for these rewritings (and the ones in FoldMemRefAliasOps.) One step at a time! Differential Revision: https://reviews.llvm.org/D146724
Loading
Please sign in to comment