David Neto dffa60ca98 spir-writer: handle break continuing block
The continuing block can exit the loop in very constrained ways:

When a break statement is placed such that it would exit from a loop’s
§ 7.3.8 Continuing Statement, then:

   - The break statement must appear as either:
     - The only statement in the if clause of an if statement that has:
       - no else clause or an empty else clause
       - no elseif clauses
     - The only statement in the else clause of an if statement that has an
       empty if clause and no elseif clauses.
   - That if statement must appear last in the continuing clause.

By design, this allows a lossless round-trip from SPIR-V to WGSL and
back to SPIR-V.  But that requires this special case construct in WGSL
to be translated to an OpBranchConditional with one target being
the loop's megre block (which is where 'break' branches to), and the
other targets the loop header (which is the loop backedge).  That
OpBranchConditional takes the place of the normal case of an
unconditional backedge.

Avoids errors like this:
 continue construct with the continue target X is not
 post dominated by the back-edge block Y

Fixed: 1034
Change-Id: If472a179380b8d77af746a3cd8e279c8a5e56b37
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59800
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-07-27 15:12:27 +00:00

853 lines
31 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 522
; Schema: 0
OpCapability Shader
%290 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %data "data"
OpName %temp "temp"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_28 "x_28"
OpName %gl_FragCoord "gl_FragCoord"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %merge_i1_i1_i1_ "merge_i1_i1_i1_"
OpName %from "from"
OpName %mid "mid"
OpName %to "to"
OpName %k "k"
OpName %i "i"
OpName %j "j"
OpName %i_1 "i_1"
OpName %x_285 "x_285"
OpName %x_286 "x_286"
OpName %x_305 "x_305"
OpName %x_306 "x_306"
OpName %x_320 "x_320"
OpName %x_324 "x_324"
OpName %x_339 "x_339"
OpName %x_338 "x_338"
OpName %x_352 "x_352"
OpName %x_351 "x_351"
OpName %x_366 "x_366"
OpName %x_365 "x_365"
OpName %x_287_phi "x_287_phi"
OpName %x_307_phi "x_307_phi"
OpName %x_328_phi "x_328_phi"
OpName %x_340_phi "x_340_phi"
OpName %x_353_phi "x_353_phi"
OpName %x_367_phi "x_367_phi"
OpName %mergeSort_ "mergeSort_"
OpName %low "low"
OpName %high "high"
OpName %m "m"
OpName %i_2 "i_2"
OpName %from_1 "from_1"
OpName %mid_1 "mid_1"
OpName %to_1 "to_1"
OpName %param "param"
OpName %param_1 "param_1"
OpName %param_2 "param_2"
OpName %main_1 "main_1"
OpName %i_3 "i_3"
OpName %j_1 "j_1"
OpName %grey "grey"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %_arr_int_uint_10 ArrayStride 4
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_28 NonWritable
OpDecorate %x_28 DescriptorSet 0
OpDecorate %x_28 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_10 = OpConstant %uint 10
%_arr_int_uint_10 = OpTypeArray %int %uint_10
%_ptr_Private__arr_int_uint_10 = OpTypePointer Private %_arr_int_uint_10
%7 = OpConstantNull %_arr_int_uint_10
%data = OpVariable %_ptr_Private__arr_int_uint_10 Private %7
%temp = OpVariable %_ptr_Private__arr_int_uint_10 Private %7
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_28 = OpVariable %_ptr_Uniform_buf0 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%17 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %17
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %17
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %17
%void = OpTypeVoid
%_ptr_Function_int = OpTypePointer Function %int
%23 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_int
%32 = OpConstantNull %int
%int_1 = OpConstant %int 1
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_1 = OpConstant %float 1
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%int_0 = OpConstant %int 0
%uint_1 = OpConstant %uint 1
%float_0 = OpConstant %float 0
%int_10 = OpConstant %int 10
%246 = OpTypeFunction %void
%int_9 = OpConstant %int 9
%int_2 = OpConstant %int 2
%_ptr_Function_float = OpTypePointer Function %float
%314 = OpConstantNull %float
%int_n5 = OpConstant %int -5
%int_n4 = OpConstant %int -4
%int_n3 = OpConstant %int -3
%int_n2 = OpConstant %int -2
%int_n1 = OpConstant %int -1
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%_ptr_Private_float = OpTypePointer Private %float
%int_30 = OpConstant %int 30
%float_0_5 = OpConstant %float 0.5
%float_10 = OpConstant %float 10
%int_60 = OpConstant %int 60
%int_90 = OpConstant %int 90
%int_120 = OpConstant %int 120
%int_150 = OpConstant %int 150
%int_180 = OpConstant %int 180
%int_5 = OpConstant %int 5
%int_210 = OpConstant %int 210
%int_6 = OpConstant %int 6
%int_240 = OpConstant %int 240
%int_7 = OpConstant %int 7
%int_270 = OpConstant %int 270
%int_8 = OpConstant %int 8
%v3float = OpTypeVector %float 3
%main_out = OpTypeStruct %v4float
%509 = OpTypeFunction %void %main_out
%merge_i1_i1_i1_ = OpFunction %void None %23
%from = OpFunctionParameter %_ptr_Function_int
%mid = OpFunctionParameter %_ptr_Function_int
%to = OpFunctionParameter %_ptr_Function_int
%30 = OpLabel
%k = OpVariable %_ptr_Function_int Function %32
%i = OpVariable %_ptr_Function_int Function %32
%j = OpVariable %_ptr_Function_int Function %32
%i_1 = OpVariable %_ptr_Function_int Function %32
%x_285 = OpVariable %_ptr_Function_int Function %32
%x_286 = OpVariable %_ptr_Function_int Function %32
%x_305 = OpVariable %_ptr_Function_int Function %32
%x_306 = OpVariable %_ptr_Function_int Function %32
%x_320 = OpVariable %_ptr_Function_int Function %32
%x_324 = OpVariable %_ptr_Function_int Function %32
%x_339 = OpVariable %_ptr_Function_int Function %32
%x_338 = OpVariable %_ptr_Function_int Function %32
%x_352 = OpVariable %_ptr_Function_int Function %32
%x_351 = OpVariable %_ptr_Function_int Function %32
%x_366 = OpVariable %_ptr_Function_int Function %32
%x_365 = OpVariable %_ptr_Function_int Function %32
%x_287_phi = OpVariable %_ptr_Function_int Function %32
%x_307_phi = OpVariable %_ptr_Function_int Function %32
%x_328_phi = OpVariable %_ptr_Function_int Function %32
%x_340_phi = OpVariable %_ptr_Function_int Function %32
%x_353_phi = OpVariable %_ptr_Function_int Function %32
%x_367_phi = OpVariable %_ptr_Function_int Function %32
%37 = OpLoad %int %from
OpStore %k %37
%39 = OpLoad %int %from
OpStore %i %39
%41 = OpLoad %int %mid
%43 = OpIAdd %int %41 %int_1
OpStore %j %43
OpBranch %44
%44 = OpLabel
OpLoopMerge %45 %46 None
OpBranch %47
%47 = OpLabel
%68 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_0
%69 = OpLoad %float %68
%71 = OpFOrdGreaterThanEqual %bool %float_1 %69
OpSelectionMerge %73 None
OpBranchConditional %71 %74 %75
%74 = OpLabel
OpBranch %73
%75 = OpLabel
OpBranch %46
%73 = OpLabel
%76 = OpLoad %int %i
%78 = OpLoad %int %mid
%79 = OpLoad %int %j
%81 = OpLoad %int %to
%82 = OpSLessThanEqual %bool %76 %78
OpSelectionMerge %83 None
OpBranchConditional %82 %84 %83
%84 = OpLabel
%85 = OpSLessThanEqual %bool %79 %81
OpBranch %83
%83 = OpLabel
%86 = OpPhi %bool %82 %73 %85 %84
OpSelectionMerge %87 None
OpBranchConditional %86 %88 %89
%88 = OpLabel
OpBranch %87
%89 = OpLabel
OpBranch %45
%87 = OpLabel
%90 = OpLoad %int %i
%92 = OpAccessChain %_ptr_Private_int %data %90
%93 = OpLoad %int %92
%94 = OpLoad %int %j
%95 = OpAccessChain %_ptr_Private_int %data %94
%96 = OpLoad %int %95
%97 = OpSLessThan %bool %93 %96
OpSelectionMerge %98 None
OpBranchConditional %97 %99 %100
%99 = OpLabel
%101 = OpLoad %int %k
OpStore %x_285 %101
%102 = OpLoad %int %x_285
OpStore %x_287_phi %102
OpBranch %98
%100 = OpLabel
OpStore %x_286 %int_0
%104 = OpLoad %int %x_286
OpStore %x_287_phi %104
OpBranch %98
%98 = OpLabel
%105 = OpLoad %int %x_287_phi
%106 = OpIAdd %int %105 %int_1
OpSelectionMerge %107 None
OpBranchConditional %97 %108 %107
%108 = OpLabel
OpStore %k %106
%109 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_0
%110 = OpLoad %float %109
%112 = OpFOrdLessThanEqual %bool %float_1 %110
%111 = OpLogicalNot %bool %112
OpSelectionMerge %113 None
OpBranchConditional %111 %114 %115
%114 = OpLabel
OpBranch %113
%115 = OpLabel
OpBranch %46
%113 = OpLabel
OpBranch %107
%107 = OpLabel
%117 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_1
%118 = OpLoad %float %117
%120 = OpFOrdGreaterThanEqual %bool %118 %float_0
OpSelectionMerge %121 None
OpBranchConditional %120 %122 %123
%122 = OpLabel
OpBranch %121
%123 = OpLabel
OpBranch %46
%121 = OpLabel
OpSelectionMerge %124 None
OpBranchConditional %97 %125 %126
%125 = OpLabel
%127 = OpLoad %int %i
OpStore %x_305 %127
%128 = OpLoad %int %x_305
OpStore %x_307_phi %128
OpBranch %124
%126 = OpLabel
OpStore %x_306 %int_0
%129 = OpLoad %int %x_306
OpStore %x_307_phi %129
OpBranch %124
%124 = OpLabel
%130 = OpLoad %int %x_307_phi
%131 = OpSelect %int %97 %130 %int_0
OpSelectionMerge %132 None
OpBranchConditional %97 %133 %132
%133 = OpLabel
%134 = OpIAdd %int %131 %int_1
OpStore %i %134
OpBranch %132
%132 = OpLabel
OpSelectionMerge %135 None
OpBranchConditional %97 %136 %137
%136 = OpLabel
%138 = OpAccessChain %_ptr_Private_int %data %131
%139 = OpLoad %int %138
OpStore %x_320 %139
%140 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_1
%141 = OpLoad %float %140
%142 = OpLoad %int %x_320
OpStore %x_328_phi %142
%144 = OpFOrdLessThanEqual %bool %float_0 %141
%143 = OpLogicalNot %bool %144
OpSelectionMerge %145 None
OpBranchConditional %143 %146 %145
%146 = OpLabel
OpBranch %46
%145 = OpLabel
OpBranch %135
%137 = OpLabel
OpStore %x_324 %int_0
%147 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_1
%148 = OpLoad %float %147
%149 = OpLoad %int %x_324
OpStore %x_328_phi %149
%151 = OpFOrdLessThan %bool %148 %float_0
%150 = OpLogicalNot %bool %151
OpSelectionMerge %152 None
OpBranchConditional %150 %153 %154
%153 = OpLabel
OpBranch %152
%154 = OpLabel
OpBranch %46
%152 = OpLabel
OpBranch %135
%135 = OpLabel
%155 = OpLoad %int %x_328_phi
OpSelectionMerge %156 None
OpBranchConditional %97 %157 %156
%157 = OpLabel
%158 = OpAccessChain %_ptr_Private_int %temp %105
%159 = OpSelect %int %97 %155 %int_0
OpStore %158 %159
OpBranch %156
%156 = OpLabel
OpSelectionMerge %160 None
OpBranchConditional %97 %161 %162
%161 = OpLabel
OpStore %x_339 %int_0
%163 = OpLoad %int %x_339
OpStore %x_340_phi %163
OpBranch %160
%162 = OpLabel
%164 = OpLoad %int %k
OpStore %x_338 %164
%165 = OpLoad %int %x_338
OpStore %x_340_phi %165
OpBranch %160
%160 = OpLabel
%166 = OpLoad %int %x_340_phi
OpSelectionMerge %167 None
OpBranchConditional %97 %168 %169
%168 = OpLabel
OpBranch %167
%169 = OpLabel
%170 = OpIAdd %int %166 %int_1
OpStore %k %170
OpBranch %167
%167 = OpLabel
%171 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_0
%172 = OpLoad %float %171
%174 = OpFOrdLessThanEqual %bool %float_1 %172
%173 = OpLogicalNot %bool %174
OpSelectionMerge %175 None
OpBranchConditional %173 %176 %177
%176 = OpLabel
OpBranch %175
%177 = OpLabel
OpBranch %46
%175 = OpLabel
OpSelectionMerge %178 None
OpBranchConditional %97 %179 %180
%179 = OpLabel
OpStore %x_352 %int_0
%181 = OpLoad %int %x_352
OpStore %x_353_phi %181
OpBranch %178
%180 = OpLabel
%182 = OpLoad %int %j
OpStore %x_351 %182
%183 = OpLoad %int %x_351
OpStore %x_353_phi %183
OpBranch %178
%178 = OpLabel
%184 = OpLoad %int %x_353_phi
%185 = OpSelect %int %97 %int_0 %184
OpSelectionMerge %186 None
OpBranchConditional %97 %187 %188
%187 = OpLabel
OpBranch %186
%188 = OpLabel
%189 = OpIAdd %int %185 %int_1
OpStore %j %189
OpBranch %186
%186 = OpLabel
OpSelectionMerge %190 None
OpBranchConditional %97 %191 %192
%191 = OpLabel
OpStore %x_366 %int_0
%193 = OpLoad %int %x_366
OpStore %x_367_phi %193
OpBranch %190
%192 = OpLabel
%194 = OpAccessChain %_ptr_Private_int %data %185
%195 = OpLoad %int %194
OpStore %x_365 %195
%196 = OpLoad %int %x_365
OpStore %x_367_phi %196
OpBranch %190
%190 = OpLabel
%197 = OpLoad %int %x_367_phi
OpSelectionMerge %198 None
OpBranchConditional %97 %199 %200
%199 = OpLabel
OpBranch %198
%200 = OpLabel
%201 = OpAccessChain %_ptr_Private_int %temp %166
OpStore %201 %197
OpBranch %198
%198 = OpLabel
OpBranch %46
%46 = OpLabel
OpBranch %44
%45 = OpLabel
OpBranch %202
%202 = OpLabel
OpLoopMerge %203 %204 None
OpBranch %205
%205 = OpLabel
%206 = OpLoad %int %i
%207 = OpLoad %int %i
%209 = OpLoad %int %mid
%211 = OpSLessThan %bool %206 %int_10
OpSelectionMerge %212 None
OpBranchConditional %211 %213 %212
%213 = OpLabel
%214 = OpSLessThanEqual %bool %207 %209
OpBranch %212
%212 = OpLabel
%215 = OpPhi %bool %211 %205 %214 %213
OpSelectionMerge %216 None
OpBranchConditional %215 %217 %218
%217 = OpLabel
OpBranch %216
%218 = OpLabel
OpBranch %203
%216 = OpLabel
%219 = OpLoad %int %k
%220 = OpIAdd %int %219 %int_1
OpStore %k %220
%221 = OpLoad %int %i
%222 = OpIAdd %int %221 %int_1
OpStore %i %222
%223 = OpAccessChain %_ptr_Private_int %data %221
%224 = OpLoad %int %223
%225 = OpAccessChain %_ptr_Private_int %temp %219
OpStore %225 %224
OpBranch %204
%204 = OpLabel
OpBranch %202
%203 = OpLabel
%227 = OpLoad %int %from
OpStore %i_1 %227
OpBranch %228
%228 = OpLabel
OpLoopMerge %229 %230 None
OpBranch %231
%231 = OpLabel
%232 = OpLoad %int %i_1
%234 = OpLoad %int %to
%235 = OpSLessThanEqual %bool %232 %234
OpSelectionMerge %236 None
OpBranchConditional %235 %237 %238
%237 = OpLabel
OpBranch %236
%238 = OpLabel
OpBranch %229
%236 = OpLabel
%239 = OpLoad %int %i_1
%240 = OpLoad %int %i_1
%241 = OpAccessChain %_ptr_Private_int %temp %240
%242 = OpLoad %int %241
%243 = OpAccessChain %_ptr_Private_int %data %239
OpStore %243 %242
OpBranch %230
%230 = OpLabel
%244 = OpLoad %int %i_1
%245 = OpIAdd %int %244 %int_1
OpStore %i_1 %245
OpBranch %228
%229 = OpLabel
OpReturn
OpFunctionEnd
%mergeSort_ = OpFunction %void None %246
%248 = OpLabel
%low = OpVariable %_ptr_Function_int Function %32
%high = OpVariable %_ptr_Function_int Function %32
%m = OpVariable %_ptr_Function_int Function %32
%i_2 = OpVariable %_ptr_Function_int Function %32
%from_1 = OpVariable %_ptr_Function_int Function %32
%mid_1 = OpVariable %_ptr_Function_int Function %32
%to_1 = OpVariable %_ptr_Function_int Function %32
%param = OpVariable %_ptr_Function_int Function %32
%param_1 = OpVariable %_ptr_Function_int Function %32
%param_2 = OpVariable %_ptr_Function_int Function %32
OpStore %low %int_0
OpStore %high %int_9
OpStore %m %int_1
OpBranch %260
%260 = OpLabel
OpLoopMerge %261 %262 None
OpBranch %263
%263 = OpLabel
%264 = OpLoad %int %m
%265 = OpLoad %int %high
%266 = OpSLessThanEqual %bool %264 %265
OpSelectionMerge %267 None
OpBranchConditional %266 %268 %269
%268 = OpLabel
OpBranch %267
%269 = OpLabel
OpBranch %261
%267 = OpLabel
%270 = OpLoad %int %low
OpStore %i_2 %270
OpBranch %271
%271 = OpLabel
OpLoopMerge %272 %273 None
OpBranch %274
%274 = OpLabel
%275 = OpLoad %int %i_2
%276 = OpLoad %int %high
%277 = OpSLessThan %bool %275 %276
OpSelectionMerge %278 None
OpBranchConditional %277 %279 %280
%279 = OpLabel
OpBranch %278
%280 = OpLabel
OpBranch %272
%278 = OpLabel
%281 = OpLoad %int %i_2
OpStore %from_1 %281
%282 = OpLoad %int %i_2
%283 = OpLoad %int %m
%284 = OpIAdd %int %282 %283
%285 = OpISub %int %284 %int_1
OpStore %mid_1 %285
%286 = OpLoad %int %i_2
%287 = OpLoad %int %m
%288 = OpLoad %int %high
%292 = OpIMul %int %int_2 %287
%293 = OpIAdd %int %286 %292
%294 = OpISub %int %293 %int_1
%289 = OpExtInst %int %290 SMin %294 %288
OpStore %to_1 %289
%295 = OpLoad %int %from_1
OpStore %param %295
%296 = OpLoad %int %mid_1
OpStore %param_1 %296
%297 = OpLoad %int %to_1
OpStore %param_2 %297
%298 = OpFunctionCall %void %merge_i1_i1_i1_ %param %param_1 %param_2
OpBranch %273
%273 = OpLabel
%302 = OpLoad %int %m
%303 = OpLoad %int %i_2
%304 = OpIMul %int %int_2 %302
%305 = OpIAdd %int %303 %304
OpStore %i_2 %305
OpBranch %271
%272 = OpLabel
OpBranch %262
%262 = OpLabel
%306 = OpLoad %int %m
%307 = OpIMul %int %int_2 %306
OpStore %m %307
OpBranch %260
%261 = OpLabel
OpReturn
OpFunctionEnd
%main_1 = OpFunction %void None %246
%309 = OpLabel
%i_3 = OpVariable %_ptr_Function_int Function %32
%j_1 = OpVariable %_ptr_Function_int Function %32
%grey = OpVariable %_ptr_Function_float Function %314
%315 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_0
%316 = OpLoad %float %315
%317 = OpConvertFToS %int %316
OpStore %i_3 %317
OpBranch %318
%318 = OpLabel
OpLoopMerge %319 %320 None
OpBranch %321
%321 = OpLabel
%322 = OpLoad %int %i_3
OpSelectionMerge %323 None
OpSwitch %322 %324 9 %325 8 %326 7 %327 6 %328 5 %329 4 %330 3 %331 2 %332 1 %333 0 %334
%325 = OpLabel
%335 = OpLoad %int %i_3
%336 = OpAccessChain %_ptr_Private_int %data %335
OpStore %336 %int_n5
OpBranch %323
%326 = OpLabel
%338 = OpLoad %int %i_3
%339 = OpAccessChain %_ptr_Private_int %data %338
OpStore %339 %int_n4
OpBranch %323
%327 = OpLabel
%341 = OpLoad %int %i_3
%342 = OpAccessChain %_ptr_Private_int %data %341
OpStore %342 %int_n3
OpBranch %323
%328 = OpLabel
%344 = OpLoad %int %i_3
%345 = OpAccessChain %_ptr_Private_int %data %344
OpStore %345 %int_n2
OpBranch %323
%329 = OpLabel
%347 = OpLoad %int %i_3
%348 = OpAccessChain %_ptr_Private_int %data %347
OpStore %348 %int_n1
OpBranch %323
%330 = OpLabel
%350 = OpLoad %int %i_3
%351 = OpAccessChain %_ptr_Private_int %data %350
OpStore %351 %int_0
OpBranch %323
%331 = OpLabel
%352 = OpLoad %int %i_3
%353 = OpAccessChain %_ptr_Private_int %data %352
OpStore %353 %int_1
OpBranch %323
%332 = OpLabel
%354 = OpLoad %int %i_3
%355 = OpAccessChain %_ptr_Private_int %data %354
OpStore %355 %int_2
OpBranch %323
%333 = OpLabel
%356 = OpLoad %int %i_3
%357 = OpAccessChain %_ptr_Private_int %data %356
OpStore %357 %int_3
OpBranch %323
%334 = OpLabel
%359 = OpLoad %int %i_3
%360 = OpAccessChain %_ptr_Private_int %data %359
OpStore %360 %int_4
OpBranch %323
%324 = OpLabel
OpBranch %323
%323 = OpLabel
%362 = OpLoad %int %i_3
%363 = OpIAdd %int %362 %int_1
OpStore %i_3 %363
OpBranch %320
%320 = OpLabel
%364 = OpLoad %int %i_3
%365 = OpSLessThan %bool %364 %int_10
OpBranchConditional %365 %318 %319
%319 = OpLabel
OpStore %j_1 %int_0
OpBranch %366
%366 = OpLabel
OpLoopMerge %367 %368 None
OpBranch %369
%369 = OpLabel
%370 = OpLoad %int %j_1
%371 = OpSLessThan %bool %370 %int_10
OpSelectionMerge %372 None
OpBranchConditional %371 %373 %374
%373 = OpLabel
OpBranch %372
%374 = OpLabel
OpBranch %367
%372 = OpLabel
%375 = OpLoad %int %j_1
%376 = OpLoad %int %j_1
%377 = OpAccessChain %_ptr_Private_int %data %376
%378 = OpLoad %int %377
%379 = OpAccessChain %_ptr_Private_int %temp %375
OpStore %379 %378
OpBranch %368
%368 = OpLabel
%380 = OpLoad %int %j_1
%381 = OpIAdd %int %380 %int_1
OpStore %j_1 %381
OpBranch %366
%367 = OpLabel
%382 = OpFunctionCall %void %mergeSort_
%384 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%385 = OpLoad %float %384
%386 = OpConvertFToS %int %385
%388 = OpSLessThan %bool %386 %int_30
OpSelectionMerge %389 None
OpBranchConditional %388 %390 %391
%390 = OpLabel
%392 = OpAccessChain %_ptr_Private_int %data %int_0
%393 = OpLoad %int %392
%395 = OpConvertSToF %float %393
%397 = OpFDiv %float %395 %float_10
%398 = OpFAdd %float %float_0_5 %397
OpStore %grey %398
OpBranch %389
%391 = OpLabel
%399 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%400 = OpLoad %float %399
%401 = OpConvertFToS %int %400
%403 = OpSLessThan %bool %401 %int_60
OpSelectionMerge %404 None
OpBranchConditional %403 %405 %406
%405 = OpLabel
%407 = OpAccessChain %_ptr_Private_int %data %int_1
%408 = OpLoad %int %407
%409 = OpConvertSToF %float %408
%410 = OpFDiv %float %409 %float_10
%411 = OpFAdd %float %float_0_5 %410
OpStore %grey %411
OpBranch %404
%406 = OpLabel
%412 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%413 = OpLoad %float %412
%414 = OpConvertFToS %int %413
%416 = OpSLessThan %bool %414 %int_90
OpSelectionMerge %417 None
OpBranchConditional %416 %418 %419
%418 = OpLabel
%420 = OpAccessChain %_ptr_Private_int %data %int_2
%421 = OpLoad %int %420
%422 = OpConvertSToF %float %421
%423 = OpFDiv %float %422 %float_10
%424 = OpFAdd %float %float_0_5 %423
OpStore %grey %424
OpBranch %417
%419 = OpLabel
%425 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%426 = OpLoad %float %425
%427 = OpConvertFToS %int %426
%429 = OpSLessThan %bool %427 %int_120
OpSelectionMerge %430 None
OpBranchConditional %429 %431 %432
%431 = OpLabel
%433 = OpAccessChain %_ptr_Private_int %data %int_3
%434 = OpLoad %int %433
%435 = OpConvertSToF %float %434
%436 = OpFDiv %float %435 %float_10
%437 = OpFAdd %float %float_0_5 %436
OpStore %grey %437
OpBranch %430
%432 = OpLabel
%438 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%439 = OpLoad %float %438
%440 = OpConvertFToS %int %439
%442 = OpSLessThan %bool %440 %int_150
OpSelectionMerge %443 None
OpBranchConditional %442 %444 %445
%444 = OpLabel
OpKill
%445 = OpLabel
%446 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%447 = OpLoad %float %446
%448 = OpConvertFToS %int %447
%450 = OpSLessThan %bool %448 %int_180
OpSelectionMerge %451 None
OpBranchConditional %450 %452 %453
%452 = OpLabel
%455 = OpAccessChain %_ptr_Private_int %data %int_5
%456 = OpLoad %int %455
%457 = OpConvertSToF %float %456
%458 = OpFDiv %float %457 %float_10
%459 = OpFAdd %float %float_0_5 %458
OpStore %grey %459
OpBranch %451
%453 = OpLabel
%460 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%461 = OpLoad %float %460
%462 = OpConvertFToS %int %461
%464 = OpSLessThan %bool %462 %int_210
OpSelectionMerge %465 None
OpBranchConditional %464 %466 %467
%466 = OpLabel
%469 = OpAccessChain %_ptr_Private_int %data %int_6
%470 = OpLoad %int %469
%471 = OpConvertSToF %float %470
%472 = OpFDiv %float %471 %float_10
%473 = OpFAdd %float %float_0_5 %472
OpStore %grey %473
OpBranch %465
%467 = OpLabel
%474 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%475 = OpLoad %float %474
%476 = OpConvertFToS %int %475
%478 = OpSLessThan %bool %476 %int_240
OpSelectionMerge %479 None
OpBranchConditional %478 %480 %481
%480 = OpLabel
%483 = OpAccessChain %_ptr_Private_int %data %int_7
%484 = OpLoad %int %483
%485 = OpConvertSToF %float %484
%486 = OpFDiv %float %485 %float_10
%487 = OpFAdd %float %float_0_5 %486
OpStore %grey %487
OpBranch %479
%481 = OpLabel
%488 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%489 = OpLoad %float %488
%490 = OpConvertFToS %int %489
%492 = OpSLessThan %bool %490 %int_270
OpSelectionMerge %493 None
OpBranchConditional %492 %494 %495
%494 = OpLabel
%497 = OpAccessChain %_ptr_Private_int %data %int_8
%498 = OpLoad %int %497
%499 = OpConvertSToF %float %498
%500 = OpFDiv %float %499 %float_10
%501 = OpFAdd %float %float_0_5 %500
OpStore %grey %501
OpBranch %493
%495 = OpLabel
OpKill
%493 = OpLabel
OpBranch %479
%479 = OpLabel
OpBranch %465
%465 = OpLabel
OpBranch %451
%451 = OpLabel
OpBranch %443
%443 = OpLabel
OpBranch %430
%430 = OpLabel
OpBranch %417
%417 = OpLabel
OpBranch %404
%404 = OpLabel
OpBranch %389
%389 = OpLabel
%502 = OpLoad %float %grey
%504 = OpCompositeConstruct %v3float %502 %502 %502
%505 = OpCompositeExtract %float %504 0
%506 = OpCompositeExtract %float %504 1
%507 = OpCompositeExtract %float %504 2
%508 = OpCompositeConstruct %v4float %505 %506 %507 %float_1
OpStore %x_GLF_color %508
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %509
%tint_symbol_1 = OpFunctionParameter %main_out
%513 = OpLabel
%514 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %514
OpReturn
OpFunctionEnd
%main = OpFunction %void None %246
%516 = OpLabel
%517 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %517
%518 = OpFunctionCall %void %main_1
%520 = OpLoad %v4float %x_GLF_color
%521 = OpCompositeConstruct %main_out %520
%519 = OpFunctionCall %void %tint_symbol_3 %521
OpReturn
OpFunctionEnd