[mlir][spirv] Unify aliases of different bitwidth scalar types
authorLei Zhang <antiagainst@gmail.com>
Fri, 10 Jun 2022 22:01:31 +0000 (18:01 -0400)
committerLei Zhang <antiagainst@google.com>
Fri, 10 Jun 2022 22:01:31 +0000 (18:01 -0400)
commit11cf2d5f62f94b14644fab3478f17af9cb015706
tree3c8aa1e249366926a778d5d7854f6f440a450a37
parentff4abe755279a3a47cc416ef80dbc900d9a98a19
[mlir][spirv] Unify aliases of different bitwidth scalar types

This commit extends the UnifyAliasedResourcePass to handle scalar
types of different bitwidths. It requires to get the smaller bitwidth
resource as the canonical resource so that we can avoid subcomponent
load/store. Instead we load/store multiple smaller bitwidth ones.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D127266
mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp
mlir/test/Dialect/SPIRV/Transforms/unify-aliased-resource.mlir