[PATCH 73/79] [Backport to 15] Fix SPIR-V global to function replacement for differing load types (#2160) (#2243)
In some cases, we will see IR with the following
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
...
%0 = load <6 x i32>, ptr addrspace(1) @__spirv_BuiltInGlobalInvocationId, align 32
%1 = extractelement <6 x i32> %0, i64 0
Note the global type and load type are different. Change the handling of vector loads from vector globals to reconstruct the global vector type and then bitcast to the load type.
Thanks to @jcranmer-intel for helping me find the simplest solution.
Co-authored-by: Nick Sarnie <sarnex@users.noreply.github.com>
Gbp-Pq: Name 0073-Backport-to-15-Fix-SPIR-V-global-to-function-replace.patch