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

730 lines
26 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 468
; Schema: 0
OpCapability Shader
%252 = 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 %main_1 "main_1"
OpName %x_85 "x_85"
OpName %x_86 "x_86"
OpName %x_87 "x_87"
OpName %x_88 "x_88"
OpName %x_89 "x_89"
OpName %x_90 "x_90"
OpName %x_91 "x_91"
OpName %x_92 "x_92"
OpName %x_93 "x_93"
OpName %x_94 "x_94"
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"
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"
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
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%int_10 = OpConstant %int 10
%132 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%149 = OpConstantNull %float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %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_0 = OpConstant %int 0
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%int_9 = OpConstant %int 9
%uint_1 = OpConstant %uint 1
%_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
%float_1 = OpConstant %float 1
%main_out = OpTypeStruct %v4float
%397 = 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
%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
%48 = OpLoad %int %i
%50 = OpLoad %int %mid
%51 = OpLoad %int %j
%53 = OpLoad %int %to
%54 = OpSLessThanEqual %bool %48 %50
OpSelectionMerge %56 None
OpBranchConditional %54 %57 %56
%57 = OpLabel
%58 = OpSLessThanEqual %bool %51 %53
OpBranch %56
%56 = OpLabel
%59 = OpPhi %bool %54 %47 %58 %57
OpSelectionMerge %60 None
OpBranchConditional %59 %61 %62
%61 = OpLabel
OpBranch %60
%62 = OpLabel
OpBranch %45
%60 = OpLabel
%63 = OpLoad %int %i
%65 = OpAccessChain %_ptr_Private_int %data %63
%66 = OpLoad %int %65
%67 = OpLoad %int %j
%68 = OpAccessChain %_ptr_Private_int %data %67
%69 = OpLoad %int %68
%70 = OpSLessThan %bool %66 %69
OpSelectionMerge %71 None
OpBranchConditional %70 %72 %73
%72 = OpLabel
%74 = OpLoad %int %k
%75 = OpIAdd %int %74 %int_1
OpStore %k %75
%76 = OpLoad %int %i
%77 = OpIAdd %int %76 %int_1
OpStore %i %77
%78 = OpAccessChain %_ptr_Private_int %data %76
%79 = OpLoad %int %78
%80 = OpAccessChain %_ptr_Private_int %temp %74
OpStore %80 %79
OpBranch %71
%73 = OpLabel
%81 = OpLoad %int %k
%82 = OpIAdd %int %81 %int_1
OpStore %k %82
%83 = OpLoad %int %j
%84 = OpIAdd %int %83 %int_1
OpStore %j %84
%85 = OpAccessChain %_ptr_Private_int %data %83
%86 = OpLoad %int %85
%87 = OpAccessChain %_ptr_Private_int %temp %81
OpStore %87 %86
OpBranch %71
%71 = OpLabel
OpBranch %46
%46 = OpLabel
OpBranch %44
%45 = OpLabel
OpBranch %88
%88 = OpLabel
OpLoopMerge %89 %90 None
OpBranch %91
%91 = OpLabel
%92 = OpLoad %int %i
%93 = OpLoad %int %i
%95 = OpLoad %int %mid
%97 = OpSLessThan %bool %92 %int_10
OpSelectionMerge %98 None
OpBranchConditional %97 %99 %98
%99 = OpLabel
%100 = OpSLessThanEqual %bool %93 %95
OpBranch %98
%98 = OpLabel
%101 = OpPhi %bool %97 %91 %100 %99
OpSelectionMerge %102 None
OpBranchConditional %101 %103 %104
%103 = OpLabel
OpBranch %102
%104 = OpLabel
OpBranch %89
%102 = OpLabel
%105 = OpLoad %int %k
%106 = OpIAdd %int %105 %int_1
OpStore %k %106
%107 = OpLoad %int %i
%108 = OpIAdd %int %107 %int_1
OpStore %i %108
%109 = OpAccessChain %_ptr_Private_int %data %107
%110 = OpLoad %int %109
%111 = OpAccessChain %_ptr_Private_int %temp %105
OpStore %111 %110
OpBranch %90
%90 = OpLabel
OpBranch %88
%89 = OpLabel
%113 = OpLoad %int %from
OpStore %i_1 %113
OpBranch %114
%114 = OpLabel
OpLoopMerge %115 %116 None
OpBranch %117
%117 = OpLabel
%118 = OpLoad %int %i_1
%120 = OpLoad %int %to
%121 = OpSLessThanEqual %bool %118 %120
OpSelectionMerge %122 None
OpBranchConditional %121 %123 %124
%123 = OpLabel
OpBranch %122
%124 = OpLabel
OpBranch %115
%122 = OpLabel
%125 = OpLoad %int %i_1
%126 = OpLoad %int %i_1
%127 = OpAccessChain %_ptr_Private_int %temp %126
%128 = OpLoad %int %127
%129 = OpAccessChain %_ptr_Private_int %data %125
OpStore %129 %128
OpBranch %116
%116 = OpLabel
%130 = OpLoad %int %i_1
%131 = OpIAdd %int %130 %int_1
OpStore %i_1 %131
OpBranch %114
%115 = OpLabel
OpReturn
OpFunctionEnd
%main_1 = OpFunction %void None %132
%134 = OpLabel
%x_85 = OpVariable %_ptr_Function_int Function %32
%x_86 = OpVariable %_ptr_Function_int Function %32
%x_87 = OpVariable %_ptr_Function_int Function %32
%x_88 = OpVariable %_ptr_Function_int Function %32
%x_89 = OpVariable %_ptr_Function_int Function %32
%x_90 = OpVariable %_ptr_Function_int Function %32
%x_91 = OpVariable %_ptr_Function_int Function %32
%x_92 = OpVariable %_ptr_Function_int Function %32
%x_93 = OpVariable %_ptr_Function_int Function %32
%x_94 = OpVariable %_ptr_Function_int Function %32
%i_3 = OpVariable %_ptr_Function_int Function %32
%j_1 = OpVariable %_ptr_Function_int Function %32
%grey = OpVariable %_ptr_Function_float Function %149
%152 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_0
%153 = OpLoad %float %152
%154 = OpConvertFToS %int %153
OpStore %i_3 %154
OpBranch %155
%155 = OpLabel
OpLoopMerge %156 %157 None
OpBranch %158
%158 = OpLabel
%159 = OpLoad %int %i_3
OpSelectionMerge %160 None
OpSwitch %159 %161 9 %162 8 %163 7 %164 6 %165 5 %166 4 %167 3 %168 2 %169 1 %170 0 %171
%162 = OpLabel
%172 = OpLoad %int %i_3
%173 = OpAccessChain %_ptr_Private_int %data %172
OpStore %173 %int_n5
OpBranch %160
%163 = OpLabel
%175 = OpLoad %int %i_3
%176 = OpAccessChain %_ptr_Private_int %data %175
OpStore %176 %int_n4
OpBranch %160
%164 = OpLabel
%178 = OpLoad %int %i_3
%179 = OpAccessChain %_ptr_Private_int %data %178
OpStore %179 %int_n3
OpBranch %160
%165 = OpLabel
%181 = OpLoad %int %i_3
%182 = OpAccessChain %_ptr_Private_int %data %181
OpStore %182 %int_n2
OpBranch %160
%166 = OpLabel
%184 = OpLoad %int %i_3
%185 = OpAccessChain %_ptr_Private_int %data %184
OpStore %185 %int_n1
OpBranch %160
%167 = OpLabel
%187 = OpLoad %int %i_3
%188 = OpAccessChain %_ptr_Private_int %data %187
OpStore %188 %int_0
OpBranch %160
%168 = OpLabel
%190 = OpLoad %int %i_3
%191 = OpAccessChain %_ptr_Private_int %data %190
OpStore %191 %int_1
OpBranch %160
%169 = OpLabel
%192 = OpLoad %int %i_3
%193 = OpAccessChain %_ptr_Private_int %data %192
OpStore %193 %int_2
OpBranch %160
%170 = OpLabel
%195 = OpLoad %int %i_3
%196 = OpAccessChain %_ptr_Private_int %data %195
OpStore %196 %int_3
OpBranch %160
%171 = OpLabel
%198 = OpLoad %int %i_3
%199 = OpAccessChain %_ptr_Private_int %data %198
OpStore %199 %int_4
OpBranch %160
%161 = OpLabel
OpBranch %160
%160 = OpLabel
%201 = OpLoad %int %i_3
%202 = OpIAdd %int %201 %int_1
OpStore %i_3 %202
OpBranch %157
%157 = OpLabel
%203 = OpLoad %int %i_3
%204 = OpSLessThan %bool %203 %int_10
OpBranchConditional %204 %155 %156
%156 = OpLabel
OpStore %j_1 %int_0
OpBranch %205
%205 = OpLabel
OpLoopMerge %206 %207 None
OpBranch %208
%208 = OpLabel
%209 = OpLoad %int %j_1
%210 = OpSLessThan %bool %209 %int_10
OpSelectionMerge %211 None
OpBranchConditional %210 %212 %213
%212 = OpLabel
OpBranch %211
%213 = OpLabel
OpBranch %206
%211 = OpLabel
%214 = OpLoad %int %j_1
%215 = OpLoad %int %j_1
%216 = OpAccessChain %_ptr_Private_int %data %215
%217 = OpLoad %int %216
%218 = OpAccessChain %_ptr_Private_int %temp %214
OpStore %218 %217
OpBranch %207
%207 = OpLabel
%219 = OpLoad %int %j_1
%220 = OpIAdd %int %219 %int_1
OpStore %j_1 %220
OpBranch %205
%206 = OpLabel
OpStore %x_94 %int_0
OpStore %x_93 %int_9
OpStore %x_92 %int_1
OpBranch %222
%222 = OpLabel
OpLoopMerge %223 %224 None
OpBranch %225
%225 = OpLabel
%226 = OpLoad %int %x_92
%227 = OpLoad %int %x_93
%228 = OpSLessThanEqual %bool %226 %227
OpSelectionMerge %229 None
OpBranchConditional %228 %230 %231
%230 = OpLabel
OpBranch %229
%231 = OpLabel
OpBranch %223
%229 = OpLabel
%232 = OpLoad %int %x_94
OpStore %x_91 %232
OpBranch %233
%233 = OpLabel
OpLoopMerge %234 %235 None
OpBranch %236
%236 = OpLabel
%237 = OpLoad %int %x_91
%238 = OpLoad %int %x_93
%239 = OpSLessThan %bool %237 %238
OpSelectionMerge %240 None
OpBranchConditional %239 %241 %242
%241 = OpLabel
OpBranch %240
%242 = OpLabel
OpBranch %234
%240 = OpLabel
%243 = OpLoad %int %x_91
OpStore %x_90 %243
%244 = OpLoad %int %x_91
%245 = OpLoad %int %x_92
%246 = OpIAdd %int %244 %245
%247 = OpISub %int %246 %int_1
OpStore %x_89 %247
%248 = OpLoad %int %x_91
%249 = OpLoad %int %x_92
%250 = OpLoad %int %x_93
%253 = OpIMul %int %int_2 %249
%254 = OpIAdd %int %248 %253
%255 = OpISub %int %254 %int_1
%251 = OpExtInst %int %252 SMin %255 %250
OpStore %x_88 %251
%256 = OpLoad %int %x_90
OpStore %x_87 %256
%257 = OpLoad %int %x_89
OpStore %x_86 %257
%258 = OpLoad %int %x_88
OpStore %x_85 %258
%259 = OpFunctionCall %void %merge_i1_i1_i1_ %x_87 %x_86 %x_85
OpBranch %235
%235 = OpLabel
%263 = OpLoad %int %x_92
%264 = OpLoad %int %x_91
%265 = OpIMul %int %int_2 %263
%266 = OpIAdd %int %264 %265
OpStore %x_91 %266
OpBranch %233
%234 = OpLabel
OpBranch %224
%224 = OpLabel
%267 = OpLoad %int %x_92
%268 = OpIMul %int %int_2 %267
OpStore %x_92 %268
OpBranch %222
%223 = OpLabel
%271 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%272 = OpLoad %float %271
%273 = OpConvertFToS %int %272
%275 = OpSLessThan %bool %273 %int_30
OpSelectionMerge %276 None
OpBranchConditional %275 %277 %278
%277 = OpLabel
%279 = OpAccessChain %_ptr_Private_int %data %int_0
%280 = OpLoad %int %279
%282 = OpConvertSToF %float %280
%284 = OpFDiv %float %282 %float_10
%285 = OpFAdd %float %float_0_5 %284
OpStore %grey %285
OpBranch %276
%278 = OpLabel
%286 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%287 = OpLoad %float %286
%288 = OpConvertFToS %int %287
%290 = OpSLessThan %bool %288 %int_60
OpSelectionMerge %291 None
OpBranchConditional %290 %292 %293
%292 = OpLabel
%294 = OpAccessChain %_ptr_Private_int %data %int_1
%295 = OpLoad %int %294
%296 = OpConvertSToF %float %295
%297 = OpFDiv %float %296 %float_10
%298 = OpFAdd %float %float_0_5 %297
OpStore %grey %298
OpBranch %291
%293 = OpLabel
%299 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%300 = OpLoad %float %299
%301 = OpConvertFToS %int %300
%303 = OpSLessThan %bool %301 %int_90
OpSelectionMerge %304 None
OpBranchConditional %303 %305 %306
%305 = OpLabel
%307 = OpAccessChain %_ptr_Private_int %data %int_2
%308 = OpLoad %int %307
%309 = OpConvertSToF %float %308
%310 = OpFDiv %float %309 %float_10
%311 = OpFAdd %float %float_0_5 %310
OpStore %grey %311
OpBranch %304
%306 = OpLabel
%312 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%313 = OpLoad %float %312
%314 = OpConvertFToS %int %313
%316 = OpSLessThan %bool %314 %int_120
OpSelectionMerge %317 None
OpBranchConditional %316 %318 %319
%318 = OpLabel
%320 = OpAccessChain %_ptr_Private_int %data %int_3
%321 = OpLoad %int %320
%322 = OpConvertSToF %float %321
%323 = OpFDiv %float %322 %float_10
%324 = OpFAdd %float %float_0_5 %323
OpStore %grey %324
OpBranch %317
%319 = OpLabel
%325 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%326 = OpLoad %float %325
%327 = OpConvertFToS %int %326
%329 = OpSLessThan %bool %327 %int_150
OpSelectionMerge %330 None
OpBranchConditional %329 %331 %332
%331 = OpLabel
OpKill
%332 = OpLabel
%333 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%334 = OpLoad %float %333
%335 = OpConvertFToS %int %334
%337 = OpSLessThan %bool %335 %int_180
OpSelectionMerge %338 None
OpBranchConditional %337 %339 %340
%339 = OpLabel
%342 = OpAccessChain %_ptr_Private_int %data %int_5
%343 = OpLoad %int %342
%344 = OpConvertSToF %float %343
%345 = OpFDiv %float %344 %float_10
%346 = OpFAdd %float %float_0_5 %345
OpStore %grey %346
OpBranch %338
%340 = OpLabel
%347 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%348 = OpLoad %float %347
%349 = OpConvertFToS %int %348
%351 = OpSLessThan %bool %349 %int_210
OpSelectionMerge %352 None
OpBranchConditional %351 %353 %354
%353 = OpLabel
%356 = OpAccessChain %_ptr_Private_int %data %int_6
%357 = OpLoad %int %356
%358 = OpConvertSToF %float %357
%359 = OpFDiv %float %358 %float_10
%360 = OpFAdd %float %float_0_5 %359
OpStore %grey %360
OpBranch %352
%354 = OpLabel
%361 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%362 = OpLoad %float %361
%363 = OpConvertFToS %int %362
%365 = OpSLessThan %bool %363 %int_240
OpSelectionMerge %366 None
OpBranchConditional %365 %367 %368
%367 = OpLabel
%370 = OpAccessChain %_ptr_Private_int %data %int_7
%371 = OpLoad %int %370
%372 = OpConvertSToF %float %371
%373 = OpFDiv %float %372 %float_10
%374 = OpFAdd %float %float_0_5 %373
OpStore %grey %374
OpBranch %366
%368 = OpLabel
%375 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%376 = OpLoad %float %375
%377 = OpConvertFToS %int %376
%379 = OpSLessThan %bool %377 %int_270
OpSelectionMerge %380 None
OpBranchConditional %379 %381 %382
%381 = OpLabel
%384 = OpAccessChain %_ptr_Private_int %data %int_8
%385 = OpLoad %int %384
%386 = OpConvertSToF %float %385
%387 = OpFDiv %float %386 %float_10
%388 = OpFAdd %float %float_0_5 %387
OpStore %grey %388
OpBranch %380
%382 = OpLabel
OpKill
%380 = OpLabel
OpBranch %366
%366 = OpLabel
OpBranch %352
%352 = OpLabel
OpBranch %338
%338 = OpLabel
OpBranch %330
%330 = OpLabel
OpBranch %317
%317 = OpLabel
OpBranch %304
%304 = OpLabel
OpBranch %291
%291 = OpLabel
OpBranch %276
%276 = OpLabel
%389 = OpLoad %float %grey
%391 = OpCompositeConstruct %v3float %389 %389 %389
%392 = OpCompositeExtract %float %391 0
%393 = OpCompositeExtract %float %391 1
%394 = OpCompositeExtract %float %391 2
%396 = OpCompositeConstruct %v4float %392 %393 %394 %float_1
OpStore %x_GLF_color %396
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %397
%tint_symbol_1 = OpFunctionParameter %main_out
%401 = OpLabel
%402 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %402
OpReturn
OpFunctionEnd
%main = OpFunction %void None %132
%404 = OpLabel
%405 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %405
%406 = OpFunctionCall %void %main_1
%408 = OpLoad %v4float %x_GLF_color
%409 = OpCompositeConstruct %main_out %408
%407 = OpFunctionCall %void %tint_symbol_3 %409
OpReturn
OpFunctionEnd
%mergeSort_ = OpFunction %void None %132
%411 = 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 %422
%422 = OpLabel
OpLoopMerge %423 %424 None
OpBranch %425
%425 = OpLabel
%426 = OpLoad %int %m
%427 = OpLoad %int %high
%428 = OpSLessThanEqual %bool %426 %427
OpSelectionMerge %429 None
OpBranchConditional %428 %430 %431
%430 = OpLabel
OpBranch %429
%431 = OpLabel
OpBranch %423
%429 = OpLabel
%432 = OpLoad %int %low
OpStore %i_2 %432
OpBranch %433
%433 = OpLabel
OpLoopMerge %434 %435 None
OpBranch %436
%436 = OpLabel
%437 = OpLoad %int %i_2
%438 = OpLoad %int %high
%439 = OpSLessThan %bool %437 %438
OpSelectionMerge %440 None
OpBranchConditional %439 %441 %442
%441 = OpLabel
OpBranch %440
%442 = OpLabel
OpBranch %434
%440 = OpLabel
%443 = OpLoad %int %i_2
OpStore %from_1 %443
%444 = OpLoad %int %i_2
%445 = OpLoad %int %m
%446 = OpIAdd %int %444 %445
%447 = OpISub %int %446 %int_1
OpStore %mid_1 %447
%448 = OpLoad %int %i_2
%449 = OpLoad %int %m
%450 = OpLoad %int %high
%452 = OpIMul %int %int_2 %449
%453 = OpIAdd %int %448 %452
%454 = OpISub %int %453 %int_1
%451 = OpExtInst %int %252 SMin %454 %450
OpStore %to_1 %451
%455 = OpLoad %int %from_1
OpStore %param %455
%456 = OpLoad %int %mid_1
OpStore %param_1 %456
%457 = OpLoad %int %to_1
OpStore %param_2 %457
%458 = OpFunctionCall %void %merge_i1_i1_i1_ %param %param_1 %param_2
OpBranch %435
%435 = OpLabel
%462 = OpLoad %int %m
%463 = OpLoad %int %i_2
%464 = OpIMul %int %int_2 %462
%465 = OpIAdd %int %463 %464
OpStore %i_2 %465
OpBranch %433
%434 = OpLabel
OpBranch %424
%424 = OpLabel
%466 = OpLoad %int %m
%467 = OpIMul %int %int_2 %466
OpStore %m %467
OpBranch %422
%423 = OpLabel
OpReturn
OpFunctionEnd