llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Add LowerSPIRVAddressSpaceCastsPass

Open jzc opened this issue 6 months ago • 0 comments

This PR adds the LowerSPIRVAddressSpaceCastsPass, which lowers IR patterns like

%0 = addrspacecast ptr addrspace(n) %src to ptr addrspace(4)
%1 = call ptr addrspace(n) @cast(ptr addrspace(4) %0, ...)

where @cast is one of the SPIRV OpGenericCastToPtrExplicit builtins. This can lower a dynamic runtime check at compile time if the address space can be inferred at compile time.

jzc avatar Jun 10 '25 23:06 jzc