| ; SPIR-V |
| ; Version: 1.0 |
| ; Generator: Khronos SPIR-V Tools Assembler; 0 |
| ; Bound: 40 |
| ; Schema: 0 |
| OpCapability Addresses |
| OpCapability Linkage |
| OpCapability Kernel |
| OpMemoryModel Physical32 OpenCL |
| OpEntryPoint Kernel %1 "loop_merge_branch_conditional_unroll" %gl_GlobalInvocationID |
| OpName %res "res" |
| OpName %in "in" |
| OpName %rep "rep" |
| OpName %num "num" |
| OpDecorate %6 FuncParamAttr NoCapture |
| %6 = OpDecorationGroup |
| OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId |
| OpDecorate %gl_GlobalInvocationID Constant |
| OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import |
| OpGroupDecorate %6 %res %in |
| %uint = OpTypeInt 32 0 |
| %v3uint = OpTypeVector %uint 3 |
| %_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| %bool = OpTypeBool |
| %void = OpTypeVoid |
| %uint_0 = OpConstant %uint 0 |
| %uint_1 = OpConstant %uint 1 |
| %_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %uint %uint |
| %gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input |
| %1 = OpFunction %void None %17 |
| %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint |
| %in = OpFunctionParameter %_ptr_CrossWorkgroup_uint |
| %rep = OpFunctionParameter %uint |
| %num = OpFunctionParameter %uint |
| %18 = OpLabel |
| %19 = OpVariable %_ptr_Function_uint Function |
| %20 = OpVariable %_ptr_Function_uint Function |
| %21 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 |
| %22 = OpCompositeExtract %uint %21 0 |
| OpStore %19 %uint_0 Aligned 4 |
| OpStore %20 %uint_0 Aligned 4 |
| OpBranch %23 |
| %23 = OpLabel |
| %24 = OpLoad %uint %20 |
| %25 = OpSLessThan %bool %24 %rep |
| OpLoopMerge %26 %27 Unroll |
| OpBranchConditional %25 %28 %26 |
| %28 = OpLabel |
| %29 = OpLoad %uint %20 |
| %30 = OpIMul %uint %29 %num |
| %31 = OpIAdd %uint %22 %30 |
| %32 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %in %31 |
| %33 = OpLoad %uint %32 |
| %34 = OpLoad %uint %19 |
| %35 = OpIAdd %uint %34 %33 |
| OpStore %19 %35 Aligned 4 |
| OpBranch %27 |
| %27 = OpLabel |
| %36 = OpLoad %uint %20 |
| %37 = OpIAdd %uint %36 %uint_1 |
| OpStore %20 %37 |
| OpBranch %23 |
| %26 = OpLabel |
| %38 = OpLoad %uint %19 |
| %39 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %22 |
| OpStore %39 %38 Aligned 4 |
| OpReturn |
| OpFunctionEnd |