[mlir][spirv] Support attribute in MapMemRefStorageClassPass
authorLei Zhang <antiagainst@google.com>
Fri, 18 Nov 2022 04:46:18 +0000 (23:46 -0500)
committerLei Zhang <antiagainst@google.com>
Fri, 18 Nov 2022 04:55:52 +0000 (23:55 -0500)
commit47e953e913ed6108cdb8badf4b0090f51b9e535f
tree1c385b653bde653eee94092dc87a234954932552
parentfe5b9a6a112ddc4a4b661da77a36998786c0cce7
[mlir][spirv] Support attribute in MapMemRefStorageClassPass

MemRef memory space actually can be an attribute. Update the
map function signature to accept an attribute. The default
mappings can still only covers numeric ones, but this allows
downstream callers to extend with custom memory spaces.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D138257
mlir/include/mlir/Conversion/MemRefToSPIRV/MemRefToSPIRV.h
mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp