blob: d85f3314e09f43940ac850b11e5e1b16e6fbb55d [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: buf0 = struct @align(8) {
injectionSwitch:vec2<f32> @offset(0)
}
main_out = struct @align(16) {
x_GLF_color_1:vec4<f32> @offset(0), @location(0)
}
$B1: { # root
%data:ptr<private, array<i32, 10>, read_write> = var
%temp:ptr<private, array<i32, 10>, read_write> = var
%x_28:ptr<uniform, buf0, read> = var @binding_point(0, 0)
%gl_FragCoord:ptr<private, vec4<f32>, read_write> = var
%x_GLF_color:ptr<private, vec4<f32>, read_write> = var
%continue_execution:ptr<private, bool, read_write> = var, true
}
%merge_i1_i1_i1_ = func(%f:ptr<function, i32, read_write>, %mid:ptr<function, i32, read_write>, %to:ptr<function, i32, read_write>):void {
$B2: {
%k:ptr<function, i32, read_write> = var
%i:ptr<function, i32, read_write> = var
%j:ptr<function, i32, read_write> = var
%i_1:ptr<function, i32, read_write> = var
%15:i32 = load %f
store %k, %15
%16:i32 = load %f
store %i, %16
%17:i32 = load %mid
%18:i32 = add %17, 1i
store %j, %18
loop [b: $B3, c: $B4] { # loop_1
$B3: { # body
%19:i32 = load %i
%20:i32 = load %mid
%21:bool = lte %19, %20
%22:i32 = load %j
%23:i32 = load %to
%24:bool = lte %22, %23
%25:bool = and %21, %24
if %25 [t: $B5, f: $B6] { # if_1
$B5: { # true
exit_if # if_1
}
$B6: { # false
exit_loop # loop_1
}
}
%26:i32 = load %i
%27:ptr<private, i32, read_write> = access %data, %26
%28:i32 = load %27
%29:i32 = load %j
%30:ptr<private, i32, read_write> = access %data, %29
%31:i32 = load %30
%32:bool = lt %28, %31
if %32 [t: $B7, f: $B8] { # if_2
$B7: { # true
%33:i32 = load %k
%x_328:i32 = let %33
%35:i32 = load %k
%36:i32 = add %35, 1i
store %k, %36
%37:i32 = load %i
%x_330:i32 = let %37
%39:i32 = load %i
%40:i32 = add %39, 1i
store %i, %40
%41:ptr<private, i32, read_write> = access %temp, %x_328
%42:ptr<private, i32, read_write> = access %data, %x_330
%43:i32 = load %42
store %41, %43
exit_if # if_2
}
$B8: { # false
%44:i32 = load %k
%x_335:i32 = let %44
%46:i32 = load %k
%47:i32 = add %46, 1i
store %k, %47
%48:i32 = load %j
%x_337:i32 = let %48
%50:i32 = load %j
%51:i32 = add %50, 1i
store %j, %51
%52:ptr<private, i32, read_write> = access %temp, %x_335
%53:ptr<private, i32, read_write> = access %data, %x_337
%54:i32 = load %53
store %52, %54
exit_if # if_2
}
}
continue # -> $B4
}
$B4: { # continuing
next_iteration # -> $B3
}
}
loop [b: $B9, c: $B10] { # loop_2
$B9: { # body
%55:i32 = load %i
%56:bool = lt %55, 10i
%57:i32 = load %i
%58:i32 = load %mid
%59:bool = lte %57, %58
%60:bool = and %56, %59
if %60 [t: $B11, f: $B12] { # if_3
$B11: { # true
exit_if # if_3
}
$B12: { # false
exit_loop # loop_2
}
}
%61:i32 = load %k
%x_353:i32 = let %61
%63:i32 = load %k
%64:i32 = add %63, 1i
store %k, %64
%65:i32 = load %i
%x_355:i32 = let %65
%67:i32 = load %i
%68:i32 = add %67, 1i
store %i, %68
%69:ptr<private, i32, read_write> = access %temp, %x_353
%70:ptr<private, i32, read_write> = access %data, %x_355
%71:i32 = load %70
store %69, %71
continue # -> $B10
}
$B10: { # continuing
next_iteration # -> $B9
}
}
%72:i32 = load %f
store %i_1, %72
loop [b: $B13, c: $B14] { # loop_3
$B13: { # body
%73:i32 = load %i_1
%74:i32 = load %to
%75:bool = lte %73, %74
if %75 [t: $B15, f: $B16] { # if_4
$B15: { # true
exit_if # if_4
}
$B16: { # false
exit_loop # loop_3
}
}
%76:i32 = load %i_1
%x_369:i32 = let %76
%78:ptr<private, i32, read_write> = access %data, %x_369
%79:i32 = load %i_1
%80:ptr<private, i32, read_write> = access %temp, %79
%81:i32 = load %80
store %78, %81
continue # -> $B14
}
$B14: { # continuing
%82:i32 = load %i_1
%83:i32 = add %82, 1i
store %i_1, %83
next_iteration # -> $B13
}
}
ret
}
}
%main_1 = func():void {
$B17: {
%x_85:ptr<function, i32, read_write> = var
%x_86:ptr<function, i32, read_write> = var
%x_87:ptr<function, i32, read_write> = var
%x_88:ptr<function, i32, read_write> = var
%x_89:ptr<function, i32, read_write> = var
%x_90:ptr<function, i32, read_write> = var
%x_91:ptr<function, i32, read_write> = var
%x_92:ptr<function, i32, read_write> = var
%x_93:ptr<function, i32, read_write> = var
%x_94:ptr<function, i32, read_write> = var
%i_3:ptr<function, i32, read_write> = var
%j_1:ptr<function, i32, read_write> = var
%grey:ptr<function, f32, read_write> = var
%98:ptr<uniform, vec2<f32>, read> = access %x_28, 0u
%99:f32 = load_vector_element %98, 0u
%100:i32 = call %tint_f32_to_i32, %99
store %i_3, %100
loop [b: $B18, c: $B19] { # loop_4
$B18: { # body
%102:i32 = load %i_3
%x_102:i32 = let %102
switch %x_102 [c: (9i, $B20), c: (8i, $B21), c: (7i, $B22), c: (6i, $B23), c: (5i, $B24), c: (4i, $B25), c: (3i, $B26), c: (2i, $B27), c: (1i, $B28), c: (0i, $B29), c: (default, $B30)] { # switch_1
$B20: { # case
%104:i32 = load %i_3
%x_132:i32 = let %104
%106:ptr<private, i32, read_write> = access %data, %x_132
store %106, -5i
exit_switch # switch_1
}
$B21: { # case
%107:i32 = load %i_3
%x_130:i32 = let %107
%109:ptr<private, i32, read_write> = access %data, %x_130
store %109, -4i
exit_switch # switch_1
}
$B22: { # case
%110:i32 = load %i_3
%x_128:i32 = let %110
%112:ptr<private, i32, read_write> = access %data, %x_128
store %112, -3i
exit_switch # switch_1
}
$B23: { # case
%113:i32 = load %i_3
%x_126:i32 = let %113
%115:ptr<private, i32, read_write> = access %data, %x_126
store %115, -2i
exit_switch # switch_1
}
$B24: { # case
%116:i32 = load %i_3
%x_124:i32 = let %116
%118:ptr<private, i32, read_write> = access %data, %x_124
store %118, -1i
exit_switch # switch_1
}
$B25: { # case
%119:i32 = load %i_3
%x_122:i32 = let %119
%121:ptr<private, i32, read_write> = access %data, %x_122
store %121, 0i
exit_switch # switch_1
}
$B26: { # case
%122:i32 = load %i_3
%x_120:i32 = let %122
%124:ptr<private, i32, read_write> = access %data, %x_120
store %124, 1i
exit_switch # switch_1
}
$B27: { # case
%125:i32 = load %i_3
%x_118:i32 = let %125
%127:ptr<private, i32, read_write> = access %data, %x_118
store %127, 2i
exit_switch # switch_1
}
$B28: { # case
%128:i32 = load %i_3
%x_116:i32 = let %128
%130:ptr<private, i32, read_write> = access %data, %x_116
store %130, 3i
exit_switch # switch_1
}
$B29: { # case
%131:i32 = load %i_3
%x_114:i32 = let %131
%133:ptr<private, i32, read_write> = access %data, %x_114
store %133, 4i
exit_switch # switch_1
}
$B30: { # case
exit_switch # switch_1
}
}
%134:i32 = load %i_3
%135:i32 = add %134, 1i
store %i_3, %135
continue # -> $B19
}
$B19: { # continuing
%136:i32 = load %i_3
%x_136:i32 = let %136
%138:bool = lt %x_136, 10i
%139:bool = eq %138, false
break_if %139 # -> [t: exit_loop loop_4, f: $B18]
}
}
store %j_1, 0i
loop [b: $B31, c: $B32] { # loop_5
$B31: { # body
%140:i32 = load %j_1
%141:bool = lt %140, 10i
if %141 [t: $B33, f: $B34] { # if_5
$B33: { # true
exit_if # if_5
}
$B34: { # false
exit_loop # loop_5
}
}
%142:i32 = load %j_1
%x_145:i32 = let %142
%144:ptr<private, i32, read_write> = access %temp, %x_145
%145:i32 = load %j_1
%146:ptr<private, i32, read_write> = access %data, %145
%147:i32 = load %146
store %144, %147
continue # -> $B32
}
$B32: { # continuing
%148:i32 = load %j_1
%149:i32 = add %148, 1i
store %j_1, %149
next_iteration # -> $B31
}
}
store %x_94, 0i
store %x_93, 9i
store %x_92, 1i
loop [b: $B35, c: $B36] { # loop_6
$B35: { # body
%150:i32 = load %x_92
%151:i32 = load %x_93
%152:bool = lte %150, %151
if %152 [t: $B37, f: $B38] { # if_6
$B37: { # true
exit_if # if_6
}
$B38: { # false
exit_loop # loop_6
}
}
%153:i32 = load %x_94
store %x_91, %153
loop [b: $B39, c: $B40] { # loop_7
$B39: { # body
%154:i32 = load %x_91
%155:i32 = load %x_93
%156:bool = lt %154, %155
if %156 [t: $B41, f: $B42] { # if_7
$B41: { # true
exit_if # if_7
}
$B42: { # false
exit_loop # loop_7
}
}
%157:i32 = load %x_91
store %x_90, %157
%158:i32 = load %x_91
%159:i32 = load %x_92
%160:i32 = add %158, %159
%161:i32 = sub %160, 1i
store %x_89, %161
%162:i32 = load %x_91
%163:i32 = load %x_92
%164:i32 = mul 2i, %163
%165:i32 = add %162, %164
%166:i32 = sub %165, 1i
%167:i32 = load %x_93
%168:i32 = min %166, %167
store %x_88, %168
%169:i32 = load %x_90
store %x_87, %169
%170:i32 = load %x_89
store %x_86, %170
%171:i32 = load %x_88
store %x_85, %171
%172:void = call %merge_i1_i1_i1_, %x_87, %x_86, %x_85
continue # -> $B40
}
$B40: { # continuing
%173:i32 = load %x_91
%174:i32 = load %x_92
%175:i32 = mul 2i, %174
%176:i32 = add %173, %175
store %x_91, %176
next_iteration # -> $B39
}
}
continue # -> $B36
}
$B36: { # continuing
%177:i32 = load %x_92
%178:i32 = mul 2i, %177
store %x_92, %178
next_iteration # -> $B35
}
}
%179:f32 = load_vector_element %gl_FragCoord, 1u
%180:i32 = call %tint_f32_to_i32, %179
%181:bool = lt %180, 30i
if %181 [t: $B43, f: $B44] { # if_8
$B43: { # true
%182:ptr<private, i32, read_write> = access %data, 0i
%183:i32 = load %182
%184:f32 = convert %183
%185:f32 = div %184, 10.0f
%186:f32 = add 0.5f, %185
store %grey, %186
exit_if # if_8
}
$B44: { # false
%187:f32 = load_vector_element %gl_FragCoord, 1u
%188:i32 = call %tint_f32_to_i32, %187
%189:bool = lt %188, 60i
if %189 [t: $B45, f: $B46] { # if_9
$B45: { # true
%190:ptr<private, i32, read_write> = access %data, 1i
%191:i32 = load %190
%192:f32 = convert %191
%193:f32 = div %192, 10.0f
%194:f32 = add 0.5f, %193
store %grey, %194
exit_if # if_9
}
$B46: { # false
%195:f32 = load_vector_element %gl_FragCoord, 1u
%196:i32 = call %tint_f32_to_i32, %195
%197:bool = lt %196, 90i
if %197 [t: $B47, f: $B48] { # if_10
$B47: { # true
%198:ptr<private, i32, read_write> = access %data, 2i
%199:i32 = load %198
%200:f32 = convert %199
%201:f32 = div %200, 10.0f
%202:f32 = add 0.5f, %201
store %grey, %202
exit_if # if_10
}
$B48: { # false
%203:f32 = load_vector_element %gl_FragCoord, 1u
%204:i32 = call %tint_f32_to_i32, %203
%205:bool = lt %204, 120i
if %205 [t: $B49, f: $B50] { # if_11
$B49: { # true
%206:ptr<private, i32, read_write> = access %data, 3i
%207:i32 = load %206
%208:f32 = convert %207
%209:f32 = div %208, 10.0f
%210:f32 = add 0.5f, %209
store %grey, %210
exit_if # if_11
}
$B50: { # false
%211:f32 = load_vector_element %gl_FragCoord, 1u
%212:i32 = call %tint_f32_to_i32, %211
%213:bool = lt %212, 150i
if %213 [t: $B51, f: $B52] { # if_12
$B51: { # true
store %continue_execution, false
exit_if # if_12
}
$B52: { # false
%214:f32 = load_vector_element %gl_FragCoord, 1u
%215:i32 = call %tint_f32_to_i32, %214
%216:bool = lt %215, 180i
if %216 [t: $B53, f: $B54] { # if_13
$B53: { # true
%217:ptr<private, i32, read_write> = access %data, 5i
%218:i32 = load %217
%219:f32 = convert %218
%220:f32 = div %219, 10.0f
%221:f32 = add 0.5f, %220
store %grey, %221
exit_if # if_13
}
$B54: { # false
%222:f32 = load_vector_element %gl_FragCoord, 1u
%223:i32 = call %tint_f32_to_i32, %222
%224:bool = lt %223, 210i
if %224 [t: $B55, f: $B56] { # if_14
$B55: { # true
%225:ptr<private, i32, read_write> = access %data, 6i
%226:i32 = load %225
%227:f32 = convert %226
%228:f32 = div %227, 10.0f
%229:f32 = add 0.5f, %228
store %grey, %229
exit_if # if_14
}
$B56: { # false
%230:f32 = load_vector_element %gl_FragCoord, 1u
%231:i32 = call %tint_f32_to_i32, %230
%232:bool = lt %231, 240i
if %232 [t: $B57, f: $B58] { # if_15
$B57: { # true
%233:ptr<private, i32, read_write> = access %data, 7i
%234:i32 = load %233
%235:f32 = convert %234
%236:f32 = div %235, 10.0f
%237:f32 = add 0.5f, %236
store %grey, %237
exit_if # if_15
}
$B58: { # false
%238:f32 = load_vector_element %gl_FragCoord, 1u
%239:i32 = call %tint_f32_to_i32, %238
%240:bool = lt %239, 270i
if %240 [t: $B59, f: $B60] { # if_16
$B59: { # true
%241:ptr<private, i32, read_write> = access %data, 8i
%242:i32 = load %241
%243:f32 = convert %242
%244:f32 = div %243, 10.0f
%245:f32 = add 0.5f, %244
store %grey, %245
exit_if # if_16
}
$B60: { # false
store %continue_execution, false
exit_if # if_16
}
}
exit_if # if_15
}
}
exit_if # if_14
}
}
exit_if # if_13
}
}
exit_if # if_12
}
}
exit_if # if_11
}
}
exit_if # if_10
}
}
exit_if # if_9
}
}
exit_if # if_8
}
}
%246:f32 = load %grey
%247:vec3<f32> = construct %246
%x_296:vec3<f32> = let %247
%249:f32 = access %x_296, 0u
%250:f32 = access %x_296, 1u
%251:f32 = access %x_296, 2u
%252:vec4<f32> = construct %249, %250, %251, 1.0f
store %x_GLF_color, %252
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B61: {
store %gl_FragCoord, %gl_FragCoord_param
%255:void = call %main_1
%256:vec4<f32> = load %x_GLF_color
%257:main_out = construct %256
%258:bool = load %continue_execution
%259:bool = eq %258, false
if %259 [t: $B62] { # if_17
$B62: { # true
terminate_invocation
}
}
ret %257
}
}
%mergeSort_ = func():void {
$B63: {
%low:ptr<function, i32, read_write> = var
%high:ptr<function, i32, read_write> = var
%m:ptr<function, i32, read_write> = var
%i_2:ptr<function, i32, read_write> = var
%f_1:ptr<function, i32, read_write> = var
%mid_1:ptr<function, i32, read_write> = var
%to_1:ptr<function, i32, read_write> = var
%param:ptr<function, i32, read_write> = var
%param_1:ptr<function, i32, read_write> = var
%param_2:ptr<function, i32, read_write> = var
store %low, 0i
store %high, 9i
store %m, 1i
loop [b: $B64, c: $B65] { # loop_8
$B64: { # body
%271:i32 = load %m
%272:i32 = load %high
%273:bool = lte %271, %272
if %273 [t: $B66, f: $B67] { # if_18
$B66: { # true
exit_if # if_18
}
$B67: { # false
exit_loop # loop_8
}
}
%274:i32 = load %low
store %i_2, %274
loop [b: $B68, c: $B69] { # loop_9
$B68: { # body
%275:i32 = load %i_2
%276:i32 = load %high
%277:bool = lt %275, %276
if %277 [t: $B70, f: $B71] { # if_19
$B70: { # true
exit_if # if_19
}
$B71: { # false
exit_loop # loop_9
}
}
%278:i32 = load %i_2
store %f_1, %278
%279:i32 = load %i_2
%280:i32 = load %m
%281:i32 = add %279, %280
%282:i32 = sub %281, 1i
store %mid_1, %282
%283:i32 = load %i_2
%284:i32 = load %m
%285:i32 = mul 2i, %284
%286:i32 = add %283, %285
%287:i32 = sub %286, 1i
%288:i32 = load %high
%289:i32 = min %287, %288
store %to_1, %289
%290:i32 = load %f_1
store %param, %290
%291:i32 = load %mid_1
store %param_1, %291
%292:i32 = load %to_1
store %param_2, %292
%293:void = call %merge_i1_i1_i1_, %param, %param_1, %param_2
continue # -> $B69
}
$B69: { # continuing
%294:i32 = load %i_2
%295:i32 = load %m
%296:i32 = mul 2i, %295
%297:i32 = add %294, %296
store %i_2, %297
next_iteration # -> $B68
}
}
continue # -> $B65
}
$B65: { # continuing
%298:i32 = load %m
%299:i32 = mul 2i, %298
store %m, %299
next_iteration # -> $B64
}
}
ret
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B72: {
%301:i32 = convert %value
%302:bool = gte %value, -2147483648.0f
%303:i32 = select -2147483648i, %301, %302
%304:bool = lte %value, 2147483520.0f
%305:i32 = select 2147483647i, %303, %304
ret %305
}
}
unhandled variable address space
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************