Issue |
91997
|
Summary |
[SPIR-V] Inconsistent representation of SPIR-V builtins types as either simple types or pointers to types
|
Labels |
backend:SPIR-V
|
Assignees |
michalpaszkowski
|
Reporter |
michalpaszkowski
|
SPIRVEmitIntrinsics pass inconsistently assigns types to values representing SPIR-V or OpenCL builtin using either `spv_assign_type` or `spv_assign_ptr_type`. This leads to issues in compilation e.g. when casting the types between address spaces or during runtime e.g. when passing to builtin functions.
Example of a kernel with the issue:
```
define spir_kernel void @foo() {
%event = alloca ptr, align 8
%call = call spir_func ptr @_Z29async_work_group_strided_copyPU3AS3hPU3AS1Khmm9ocl_event(ptr null, ptr null, i64 1, i64 1, ptr null)
store ptr %call, ptr %event, align 8
%event.ascast = addrspacecast ptr %event to ptr addrspace(4)
call spir_func void @_Z17wait_group_eventsiPU3AS49ocl_event(i32 2, ptr addrspace(4) %event.ascast)
ret void
}
declare spir_func ptr @_Z29async_work_group_strided_copyPU3AS3hPU3AS1Khmm9ocl_event(ptr, ptr, i64, i64, ptr)
declare spir_func void @_Z17wait_group_eventsiPU3AS49ocl_event(i32, ptr addrspace(4))
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs