-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
The following snippet fails to compile with level-zero, but it's clearly an underlying compiler issue. I'm not sure if there is an easy way to run igc offline... Anyhow, I've bisected the problem to the OpPhi of type _ptr_Input_v3uint
- removing it makes this compile just fine.
OpCapability Kernel
OpCapability Addresses
OpCapability Int64
OpCapability Linkage
OpMemoryModel Physical64 OpenCL
OpDecorate %7 Aliased
OpDecorate %8 Aliased
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
%uint = OpTypeInt 32 0
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
%void = OpTypeVoid
%5 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%_ptr_Input_uint = OpTypePointer Input %uint
%uint_0 = OpConstant %uint 0
%_mem__pu32_ = OpTypeStruct %uint
%ulong = OpTypeInt 64 0
%copy_krnl = OpFunction %void None %5
%7 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%8 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%copy_krnl_0 = OpLabel
OpBranch %cont
%cont = OpLabel
; this opphi is problematic, if we replace %12 by %gl_GlobalInvocationID and comment it out, things work just fine
%12 = OpPhi %_ptr_Input_v3uint %gl_GlobalInvocationID %copy_krnl_0
%16 = OpAccessChain %_ptr_Input_uint %12 %uint_0
%17 = OpLoad %uint %16
%20 = OpBitcast %uint %17
%21 = OpPtrAccessChain %_ptr_CrossWorkgroup_uint %7 %20
%22 = OpLoad %uint %21 Aligned 4
%23 = OpPtrAccessChain %_ptr_CrossWorkgroup_uint %8 %20
OpStore %23 %22 Aligned 4
OpReturn
OpFunctionEnd
Metadata
Metadata
Assignees
Labels
No labels