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

724 lines
26 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 466
; Schema: 0
OpCapability Shader
%250 = 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
%128 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%145 = 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
%243 = OpConstantComposite %_arr_int_uint_10 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0
%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
%395 = 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
%56 = OpSLessThanEqual %bool %51 %53
%57 = OpLogicalAnd %bool %54 %56
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %60
%59 = OpLabel
OpBranch %58
%60 = OpLabel
OpBranch %45
%58 = OpLabel
%61 = OpLoad %int %i
%63 = OpAccessChain %_ptr_Private_int %data %61
%64 = OpLoad %int %63
%65 = OpLoad %int %j
%66 = OpAccessChain %_ptr_Private_int %data %65
%67 = OpLoad %int %66
%68 = OpSLessThan %bool %64 %67
OpSelectionMerge %69 None
OpBranchConditional %68 %70 %71
%70 = OpLabel
%72 = OpLoad %int %k
%73 = OpIAdd %int %72 %int_1
OpStore %k %73
%74 = OpLoad %int %i
%75 = OpIAdd %int %74 %int_1
OpStore %i %75
%76 = OpAccessChain %_ptr_Private_int %data %74
%77 = OpLoad %int %76
%78 = OpAccessChain %_ptr_Private_int %temp %72
OpStore %78 %77
OpBranch %69
%71 = OpLabel
%79 = OpLoad %int %k
%80 = OpIAdd %int %79 %int_1
OpStore %k %80
%81 = OpLoad %int %j
%82 = OpIAdd %int %81 %int_1
OpStore %j %82
%83 = OpAccessChain %_ptr_Private_int %data %81
%84 = OpLoad %int %83
%85 = OpAccessChain %_ptr_Private_int %temp %79
OpStore %85 %84
OpBranch %69
%69 = OpLabel
OpBranch %46
%46 = OpLabel
OpBranch %44
%45 = OpLabel
OpBranch %86
%86 = OpLabel
OpLoopMerge %87 %88 None
OpBranch %89
%89 = OpLabel
%90 = OpLoad %int %i
%91 = OpLoad %int %i
%93 = OpLoad %int %mid
%95 = OpSLessThan %bool %90 %int_10
%96 = OpSLessThanEqual %bool %91 %93
%97 = OpLogicalAnd %bool %95 %96
OpSelectionMerge %98 None
OpBranchConditional %97 %99 %100
%99 = OpLabel
OpBranch %98
%100 = OpLabel
OpBranch %87
%98 = OpLabel
%101 = OpLoad %int %k
%102 = OpIAdd %int %101 %int_1
OpStore %k %102
%103 = OpLoad %int %i
%104 = OpIAdd %int %103 %int_1
OpStore %i %104
%105 = OpAccessChain %_ptr_Private_int %data %103
%106 = OpLoad %int %105
%107 = OpAccessChain %_ptr_Private_int %temp %101
OpStore %107 %106
OpBranch %88
%88 = OpLabel
OpBranch %86
%87 = OpLabel
%109 = OpLoad %int %from
OpStore %i_1 %109
OpBranch %110
%110 = OpLabel
OpLoopMerge %111 %112 None
OpBranch %113
%113 = OpLabel
%114 = OpLoad %int %i_1
%116 = OpLoad %int %to
%117 = OpSLessThanEqual %bool %114 %116
OpSelectionMerge %118 None
OpBranchConditional %117 %119 %120
%119 = OpLabel
OpBranch %118
%120 = OpLabel
OpBranch %111
%118 = OpLabel
%121 = OpLoad %int %i_1
%122 = OpLoad %int %i_1
%123 = OpAccessChain %_ptr_Private_int %temp %122
%124 = OpLoad %int %123
%125 = OpAccessChain %_ptr_Private_int %data %121
OpStore %125 %124
OpBranch %112
%112 = OpLabel
%126 = OpLoad %int %i_1
%127 = OpIAdd %int %126 %int_1
OpStore %i_1 %127
OpBranch %110
%111 = OpLabel
OpReturn
OpFunctionEnd
%main_1 = OpFunction %void None %128
%130 = 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 %145
%148 = OpAccessChain %_ptr_Uniform_float %x_28 %uint_0 %uint_0
%149 = OpLoad %float %148
%150 = OpConvertFToS %int %149
OpStore %i_3 %150
OpBranch %151
%151 = OpLabel
OpLoopMerge %152 %153 None
OpBranch %154
%154 = OpLabel
%155 = OpLoad %int %i_3
OpSelectionMerge %156 None
OpSwitch %155 %157 9 %158 8 %159 7 %160 6 %161 5 %162 4 %163 3 %164 2 %165 1 %166 0 %167
%158 = OpLabel
%168 = OpLoad %int %i_3
%169 = OpAccessChain %_ptr_Private_int %data %168
OpStore %169 %int_n5
OpBranch %156
%159 = OpLabel
%171 = OpLoad %int %i_3
%172 = OpAccessChain %_ptr_Private_int %data %171
OpStore %172 %int_n4
OpBranch %156
%160 = OpLabel
%174 = OpLoad %int %i_3
%175 = OpAccessChain %_ptr_Private_int %data %174
OpStore %175 %int_n3
OpBranch %156
%161 = OpLabel
%177 = OpLoad %int %i_3
%178 = OpAccessChain %_ptr_Private_int %data %177
OpStore %178 %int_n2
OpBranch %156
%162 = OpLabel
%180 = OpLoad %int %i_3
%181 = OpAccessChain %_ptr_Private_int %data %180
OpStore %181 %int_n1
OpBranch %156
%163 = OpLabel
%183 = OpLoad %int %i_3
%184 = OpAccessChain %_ptr_Private_int %data %183
OpStore %184 %int_0
OpBranch %156
%164 = OpLabel
%186 = OpLoad %int %i_3
%187 = OpAccessChain %_ptr_Private_int %data %186
OpStore %187 %int_1
OpBranch %156
%165 = OpLabel
%188 = OpLoad %int %i_3
%189 = OpAccessChain %_ptr_Private_int %data %188
OpStore %189 %int_2
OpBranch %156
%166 = OpLabel
%191 = OpLoad %int %i_3
%192 = OpAccessChain %_ptr_Private_int %data %191
OpStore %192 %int_3
OpBranch %156
%167 = OpLabel
%194 = OpLoad %int %i_3
%195 = OpAccessChain %_ptr_Private_int %data %194
OpStore %195 %int_4
OpBranch %156
%157 = OpLabel
OpBranch %156
%156 = OpLabel
%197 = OpLoad %int %i_3
%198 = OpIAdd %int %197 %int_1
OpStore %i_3 %198
OpBranch %153
%153 = OpLabel
%199 = OpLoad %int %i_3
%200 = OpSLessThan %bool %199 %int_10
OpBranchConditional %200 %151 %152
%152 = OpLabel
OpStore %j_1 %int_0
OpBranch %201
%201 = OpLabel
OpLoopMerge %202 %203 None
OpBranch %204
%204 = OpLabel
%205 = OpLoad %int %j_1
%206 = OpSLessThan %bool %205 %int_10
OpSelectionMerge %207 None
OpBranchConditional %206 %208 %209
%208 = OpLabel
OpBranch %207
%209 = OpLabel
OpBranch %202
%207 = OpLabel
%210 = OpLoad %int %j_1
%211 = OpLoad %int %j_1
%212 = OpAccessChain %_ptr_Private_int %data %211
%213 = OpLoad %int %212
%214 = OpAccessChain %_ptr_Private_int %temp %210
OpStore %214 %213
OpBranch %203
%203 = OpLabel
%215 = OpLoad %int %j_1
%216 = OpIAdd %int %215 %int_1
OpStore %j_1 %216
OpBranch %201
%202 = OpLabel
OpStore %x_94 %int_0
OpStore %x_93 %int_9
OpStore %x_92 %int_1
OpBranch %218
%218 = OpLabel
OpLoopMerge %219 %220 None
OpBranch %221
%221 = OpLabel
%222 = OpLoad %int %x_92
%223 = OpLoad %int %x_93
%224 = OpSLessThanEqual %bool %222 %223
OpSelectionMerge %225 None
OpBranchConditional %224 %226 %227
%226 = OpLabel
OpBranch %225
%227 = OpLabel
OpBranch %219
%225 = OpLabel
%228 = OpLoad %int %x_94
OpStore %x_91 %228
OpBranch %229
%229 = OpLabel
OpLoopMerge %230 %231 None
OpBranch %232
%232 = OpLabel
%233 = OpLoad %int %x_91
%234 = OpLoad %int %x_93
%235 = OpSLessThan %bool %233 %234
OpSelectionMerge %236 None
OpBranchConditional %235 %237 %238
%237 = OpLabel
OpBranch %236
%238 = OpLabel
OpBranch %230
%236 = OpLabel
%239 = OpLoad %int %x_91
OpStore %x_90 %239
%240 = OpLoad %int %x_91
%241 = OpLoad %int %x_92
%242 = OpLoad %_arr_int_uint_10 %data
OpStore %data %243
OpStore %data %242
%244 = OpIAdd %int %240 %241
%245 = OpISub %int %244 %int_1
OpStore %x_89 %245
%246 = OpLoad %int %x_91
%247 = OpLoad %int %x_92
%248 = OpLoad %int %x_93
%251 = OpIMul %int %int_2 %247
%252 = OpIAdd %int %246 %251
%253 = OpISub %int %252 %int_1
%249 = OpExtInst %int %250 SMin %253 %248
OpStore %x_88 %249
%254 = OpLoad %int %x_90
OpStore %x_87 %254
%255 = OpLoad %int %x_89
OpStore %x_86 %255
%256 = OpLoad %int %x_88
OpStore %x_85 %256
%257 = OpFunctionCall %void %merge_i1_i1_i1_ %x_87 %x_86 %x_85
OpBranch %231
%231 = OpLabel
%261 = OpLoad %int %x_92
%262 = OpLoad %int %x_91
%263 = OpIMul %int %int_2 %261
%264 = OpIAdd %int %262 %263
OpStore %x_91 %264
OpBranch %229
%230 = OpLabel
OpBranch %220
%220 = OpLabel
%265 = OpLoad %int %x_92
%266 = OpIMul %int %int_2 %265
OpStore %x_92 %266
OpBranch %218
%219 = OpLabel
%269 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%270 = OpLoad %float %269
%271 = OpConvertFToS %int %270
%273 = OpSLessThan %bool %271 %int_30
OpSelectionMerge %274 None
OpBranchConditional %273 %275 %276
%275 = OpLabel
%277 = OpAccessChain %_ptr_Private_int %data %int_0
%278 = OpLoad %int %277
%280 = OpConvertSToF %float %278
%282 = OpFDiv %float %280 %float_10
%283 = OpFAdd %float %float_0_5 %282
OpStore %grey %283
OpBranch %274
%276 = OpLabel
%284 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%285 = OpLoad %float %284
%286 = OpConvertFToS %int %285
%288 = OpSLessThan %bool %286 %int_60
OpSelectionMerge %289 None
OpBranchConditional %288 %290 %291
%290 = OpLabel
%292 = OpAccessChain %_ptr_Private_int %data %int_1
%293 = OpLoad %int %292
%294 = OpConvertSToF %float %293
%295 = OpFDiv %float %294 %float_10
%296 = OpFAdd %float %float_0_5 %295
OpStore %grey %296
OpBranch %289
%291 = OpLabel
%297 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%298 = OpLoad %float %297
%299 = OpConvertFToS %int %298
%301 = OpSLessThan %bool %299 %int_90
OpSelectionMerge %302 None
OpBranchConditional %301 %303 %304
%303 = OpLabel
%305 = OpAccessChain %_ptr_Private_int %data %int_2
%306 = OpLoad %int %305
%307 = OpConvertSToF %float %306
%308 = OpFDiv %float %307 %float_10
%309 = OpFAdd %float %float_0_5 %308
OpStore %grey %309
OpBranch %302
%304 = OpLabel
%310 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%311 = OpLoad %float %310
%312 = OpConvertFToS %int %311
%314 = OpSLessThan %bool %312 %int_120
OpSelectionMerge %315 None
OpBranchConditional %314 %316 %317
%316 = OpLabel
%318 = OpAccessChain %_ptr_Private_int %data %int_3
%319 = OpLoad %int %318
%320 = OpConvertSToF %float %319
%321 = OpFDiv %float %320 %float_10
%322 = OpFAdd %float %float_0_5 %321
OpStore %grey %322
OpBranch %315
%317 = OpLabel
%323 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%324 = OpLoad %float %323
%325 = OpConvertFToS %int %324
%327 = OpSLessThan %bool %325 %int_150
OpSelectionMerge %328 None
OpBranchConditional %327 %329 %330
%329 = OpLabel
OpKill
%330 = OpLabel
%331 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%332 = OpLoad %float %331
%333 = OpConvertFToS %int %332
%335 = OpSLessThan %bool %333 %int_180
OpSelectionMerge %336 None
OpBranchConditional %335 %337 %338
%337 = OpLabel
%340 = OpAccessChain %_ptr_Private_int %data %int_5
%341 = OpLoad %int %340
%342 = OpConvertSToF %float %341
%343 = OpFDiv %float %342 %float_10
%344 = OpFAdd %float %float_0_5 %343
OpStore %grey %344
OpBranch %336
%338 = OpLabel
%345 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%346 = OpLoad %float %345
%347 = OpConvertFToS %int %346
%349 = OpSLessThan %bool %347 %int_210
OpSelectionMerge %350 None
OpBranchConditional %349 %351 %352
%351 = OpLabel
%354 = OpAccessChain %_ptr_Private_int %data %int_6
%355 = OpLoad %int %354
%356 = OpConvertSToF %float %355
%357 = OpFDiv %float %356 %float_10
%358 = OpFAdd %float %float_0_5 %357
OpStore %grey %358
OpBranch %350
%352 = OpLabel
%359 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%360 = OpLoad %float %359
%361 = OpConvertFToS %int %360
%363 = OpSLessThan %bool %361 %int_240
OpSelectionMerge %364 None
OpBranchConditional %363 %365 %366
%365 = OpLabel
%368 = OpAccessChain %_ptr_Private_int %data %int_7
%369 = OpLoad %int %368
%370 = OpConvertSToF %float %369
%371 = OpFDiv %float %370 %float_10
%372 = OpFAdd %float %float_0_5 %371
OpStore %grey %372
OpBranch %364
%366 = OpLabel
%373 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%374 = OpLoad %float %373
%375 = OpConvertFToS %int %374
%377 = OpSLessThan %bool %375 %int_270
OpSelectionMerge %378 None
OpBranchConditional %377 %379 %380
%379 = OpLabel
%382 = OpAccessChain %_ptr_Private_int %data %int_8
%383 = OpLoad %int %382
%384 = OpConvertSToF %float %383
%385 = OpFDiv %float %384 %float_10
%386 = OpFAdd %float %float_0_5 %385
OpStore %grey %386
OpBranch %378
%380 = OpLabel
OpKill
%378 = OpLabel
OpBranch %364
%364 = OpLabel
OpBranch %350
%350 = OpLabel
OpBranch %336
%336 = OpLabel
OpBranch %328
%328 = OpLabel
OpBranch %315
%315 = OpLabel
OpBranch %302
%302 = OpLabel
OpBranch %289
%289 = OpLabel
OpBranch %274
%274 = OpLabel
%387 = OpLoad %float %grey
%389 = OpCompositeConstruct %v3float %387 %387 %387
%390 = OpCompositeExtract %float %389 0
%391 = OpCompositeExtract %float %389 1
%392 = OpCompositeExtract %float %389 2
%394 = OpCompositeConstruct %v4float %390 %391 %392 %float_1
OpStore %x_GLF_color %394
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %395
%tint_symbol_1 = OpFunctionParameter %main_out
%399 = OpLabel
%400 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %400
OpReturn
OpFunctionEnd
%main = OpFunction %void None %128
%402 = OpLabel
%403 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %403
%404 = OpFunctionCall %void %main_1
%406 = OpLoad %v4float %x_GLF_color
%407 = OpCompositeConstruct %main_out %406
%405 = OpFunctionCall %void %tint_symbol_3 %407
OpReturn
OpFunctionEnd
%mergeSort_ = OpFunction %void None %128
%409 = 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 %420
%420 = OpLabel
OpLoopMerge %421 %422 None
OpBranch %423
%423 = OpLabel
%424 = OpLoad %int %m
%425 = OpLoad %int %high
%426 = OpSLessThanEqual %bool %424 %425
OpSelectionMerge %427 None
OpBranchConditional %426 %428 %429
%428 = OpLabel
OpBranch %427
%429 = OpLabel
OpBranch %421
%427 = OpLabel
%430 = OpLoad %int %low
OpStore %i_2 %430
OpBranch %431
%431 = OpLabel
OpLoopMerge %432 %433 None
OpBranch %434
%434 = OpLabel
%435 = OpLoad %int %i_2
%436 = OpLoad %int %high
%437 = OpSLessThan %bool %435 %436
OpSelectionMerge %438 None
OpBranchConditional %437 %439 %440
%439 = OpLabel
OpBranch %438
%440 = OpLabel
OpBranch %432
%438 = OpLabel
%441 = OpLoad %int %i_2
OpStore %from_1 %441
%442 = OpLoad %int %i_2
%443 = OpLoad %int %m
%444 = OpIAdd %int %442 %443
%445 = OpISub %int %444 %int_1
OpStore %mid_1 %445
%446 = OpLoad %int %i_2
%447 = OpLoad %int %m
%448 = OpLoad %int %high
%450 = OpIMul %int %int_2 %447
%451 = OpIAdd %int %446 %450
%452 = OpISub %int %451 %int_1
%449 = OpExtInst %int %250 SMin %452 %448
OpStore %to_1 %449
%453 = OpLoad %int %from_1
OpStore %param %453
%454 = OpLoad %int %mid_1
OpStore %param_1 %454
%455 = OpLoad %int %to_1
OpStore %param_2 %455
%456 = OpFunctionCall %void %merge_i1_i1_i1_ %param %param_1 %param_2
OpBranch %433
%433 = OpLabel
%460 = OpLoad %int %m
%461 = OpLoad %int %i_2
%462 = OpIMul %int %int_2 %460
%463 = OpIAdd %int %461 %462
OpStore %i_2 %463
OpBranch %431
%432 = OpLabel
OpBranch %422
%422 = OpLabel
%464 = OpLoad %int %m
%465 = OpIMul %int %int_2 %464
OpStore %m %465
OpBranch %420
%421 = OpLabel
OpReturn
OpFunctionEnd