dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 1 | ; SPIR-V |
| 2 | ; Version: 1.3 |
| 3 | ; Generator: Google Tint Compiler; 1 |
| 4 | ; Bound: 49 |
| 5 | ; Schema: 0 |
| 6 | OpCapability Shader |
| 7 | OpMemoryModel Logical GLSL450 |
| 8 | OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" |
| 9 | OpExecutionMode %unused_entry_point LocalSize 1 1 1 |
| 10 | OpName %f "f" |
| 11 | OpName %return_value "return_value" |
| 12 | OpName %continue_execution "continue_execution" |
| 13 | OpName %i "i" |
| 14 | OpName %j "j" |
| 15 | OpName %unused_entry_point "unused_entry_point" |
| 16 | %int = OpTypeInt 32 1 |
| 17 | %3 = OpTypeFunction %int |
| 18 | %_ptr_Function_int = OpTypePointer Function %int |
| 19 | %7 = OpConstantNull %int |
| 20 | %bool = OpTypeBool |
| 21 | %_ptr_Function_bool = OpTypePointer Function %bool |
| 22 | %true = OpConstantTrue %bool |
| 23 | %int_1 = OpConstant %int 1 |
| 24 | %int_4 = OpConstant %int 4 |
| 25 | %false = OpConstantFalse %bool |
| 26 | %int_2 = OpConstant %int 2 |
| 27 | %void = OpTypeVoid |
| 28 | %47 = OpTypeFunction %void |
| 29 | %f = OpFunction %int None %3 |
| 30 | %4 = OpLabel |
| 31 | %return_value = OpVariable %_ptr_Function_int Function %7 |
| 32 | %continue_execution = OpVariable %_ptr_Function_bool Function |
| 33 | %i = OpVariable %_ptr_Function_int Function %7 |
| 34 | %j = OpVariable %_ptr_Function_int Function %7 |
| 35 | OpStore %continue_execution %true |
| 36 | OpBranch %16 |
| 37 | %16 = OpLabel |
| 38 | OpLoopMerge %17 %15 None |
| 39 | OpBranch %14 |
| 40 | %14 = OpLabel |
| 41 | %18 = OpLoad %int %i |
| 42 | %19 = OpIAdd %int %18 %int_1 |
| 43 | OpStore %i %19 |
| 44 | %21 = OpLoad %int %i |
| 45 | %22 = OpSGreaterThan %bool %21 %int_4 |
| 46 | OpSelectionMerge %24 None |
| 47 | OpBranchConditional %22 %25 %24 |
| 48 | %25 = OpLabel |
| 49 | OpStore %continue_execution %false |
| 50 | OpStore %return_value %int_1 |
| 51 | OpBranch %24 |
| 52 | %24 = OpLabel |
| 53 | %27 = OpLoad %bool %continue_execution |
| 54 | OpSelectionMerge %28 None |
| 55 | OpBranchConditional %27 %29 %28 |
| 56 | %29 = OpLabel |
| 57 | OpBranch %32 |
| 58 | %32 = OpLabel |
| 59 | OpLoopMerge %33 %31 None |
| 60 | OpBranch %30 |
| 61 | %30 = OpLabel |
| 62 | %34 = OpLoad %int %j |
| 63 | %35 = OpIAdd %int %34 %int_1 |
| 64 | OpStore %j %35 |
| 65 | %36 = OpLoad %int %j |
| 66 | %37 = OpSGreaterThan %bool %36 %int_4 |
| 67 | OpSelectionMerge %38 None |
| 68 | OpBranchConditional %37 %39 %38 |
| 69 | %39 = OpLabel |
| 70 | OpStore %continue_execution %false |
| 71 | OpStore %return_value %int_2 |
| 72 | OpBranch %38 |
| 73 | %38 = OpLabel |
| 74 | %41 = OpLoad %bool %continue_execution |
| 75 | OpSelectionMerge %42 None |
| 76 | OpBranchConditional %41 %43 %42 |
| 77 | %43 = OpLabel |
| 78 | OpBranch %31 |
| 79 | %42 = OpLabel |
| 80 | OpBranch %33 |
| 81 | %31 = OpLabel |
| 82 | OpBranch %32 |
| 83 | %33 = OpLabel |
| 84 | OpBranch %28 |
| 85 | %28 = OpLabel |
| 86 | OpBranch %17 |
| 87 | %15 = OpLabel |
| 88 | OpBranch %16 |
| 89 | %17 = OpLabel |
| 90 | %44 = OpLoad %int %return_value |
| 91 | OpReturnValue %44 |
| 92 | OpFunctionEnd |
| 93 | %unused_entry_point = OpFunction %void None %47 |
| 94 | %48 = OpLabel |
| 95 | OpReturn |
| 96 | OpFunctionEnd |