[mlir][spirv] Fix bitcast input order for UnifyAliasedResourcePass
authorLei Zhang <antiagainst@google.com>
Fri, 24 Jun 2022 02:19:08 +0000 (22:19 -0400)
committerLei Zhang <antiagainst@google.com>
Fri, 24 Jun 2022 02:19:08 +0000 (22:19 -0400)
commitb2671d8898e9f5aa66930ed17f9a3f108c6a9ab4
treedb8952197090b1ada703212615178348fa6e806a
parent9aaba9d9bb4fc3648a9417820858086b14b6b73e
[mlir][spirv] Fix bitcast input order for UnifyAliasedResourcePass

spv.bitcast from a vector to a scalar expects the lower-numbered
components of the the vector to map to the lower-ordered bits of
the scalar. That actually already matches how little endian stores
data in the memory. So we just need to read and push to the back
of the vector sequentially.

Reviewed By: hanchung

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