[mlir][spirv] Fix vector type mismatch in UnifyAliasedResourcePass
authorLei Zhang <antiagainst@google.com>
Wed, 1 Feb 2023 19:35:25 +0000 (19:35 +0000)
committerLei Zhang <antiagainst@google.com>
Wed, 1 Feb 2023 20:26:29 +0000 (20:26 +0000)
commit2c46051aa9d30dc1740f2183ceb45a235b994cc3
tree81078d5bfeac38e55110a5db4ae0d79a89aba18b
parent11a2b44ad412c3b94ca4559b7b813f1a3651e350
[mlir][spirv] Fix vector type mismatch in UnifyAliasedResourcePass

For the cases where we have aliases of `vector<4xf16>` and
`vector<4xf32>`, we need to do casting before composite
construction.

Reviewed By: kuhar

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