llvm-project
d6f6cdad - [SPIR-V] Fix inttoptr type deduction with ptr.annotation (#189219)

Commit
26 days ago
[SPIR-V] Fix inttoptr type deduction with ptr.annotation (#189219) Opaque pointer inttoptr was recording ptr as a pointee type, so OpConvertUToPtr was emitted as pointer-to-pointer and then bitcasted back. Please see an example below. LLVM IR: ``` %p = inttoptr i64 %x to ptr addrspace(1) %a = call ptr addrspace(1) @llvm.ptr.annotation(... %p ...) call spir_func void @prefetch(ptr addrspace(1) %a, ...) ``` SPIR-V (before the change): ``` %p2 = OpConvertUToPtr %_ptr_CrossWorkgroup__ptr_CrossWorkgroup_uchar %x %p1 = OpBitcast %_ptr_CrossWorkgroup_uchar %p2 OpFunctionCall ... %p1 ... ``` Skip assigning pointee type for inttoptr when the destination is untyped, fallback later recovers the correct single pointer type.
Parents
Loading