blob: 1473a73b71482b0788d30c84a3aeb968e1e84640 [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: BST = struct @align(4) {
data:i32 @offset(0)
leftIndex:i32 @offset(4)
rightIndex:i32 @offset(8)
}
buf0 = struct @align(8) {
injectionSwitch:vec2<f32> @offset(0)
}
Obj = struct @align(4) {
odd_numbers:array<f32, 10> @offset(0)
even_numbers:array<f32, 10> @offset(40)
}
main_out = struct @align(16) {
x_GLF_color_1:vec4<f32> @offset(0), @location(0)
}
$B1: { # root
%tree_1:ptr<private, array<BST, 10>, read_write> = var
%x_27: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
}
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = func(%tree:ptr<function, BST, read_write>, %data:ptr<function, i32, read_write>):void {
$B2: {
%8:ptr<function, i32, read_write> = access %tree, 0u
%9:i32 = load %data
store %8, %9
%10:ptr<function, i32, read_write> = access %tree, 1u
store %10, -1i
%11:ptr<function, i32, read_write> = access %tree, 2u
store %11, -1i
ret
}
}
%insert_i1_i1_ = func(%treeIndex:ptr<function, i32, read_write>, %data_1:ptr<function, i32, read_write>):void {
$B3: {
%baseIndex:ptr<function, i32, read_write> = var
%param:ptr<function, BST, read_write> = var
%param_1:ptr<function, i32, read_write> = var
%param_2:ptr<function, BST, read_write> = var
%param_3:ptr<function, i32, read_write> = var
%GLF_live8i:ptr<function, i32, read_write> = var
%GLF_live8A:ptr<function, array<f32, 50>, read_write> = var
store %baseIndex, 0i
loop [b: $B4, c: $B5] { # loop_1
$B4: { # body
%22:i32 = load %baseIndex
%23:i32 = load %treeIndex
%24:bool = lte %22, %23
if %24 [t: $B6, f: $B7] { # if_1
$B6: { # true
exit_if # if_1
}
$B7: { # false
exit_loop # loop_1
}
}
%25:i32 = load %data_1
%26:i32 = load %baseIndex
%27:ptr<private, i32, read_write> = access %tree_1, %26, 0u
%28:i32 = load %27
%29:bool = lte %25, %28
if %29 [t: $B8, f: $B9] { # if_2
$B8: { # true
%30:i32 = load %baseIndex
%31:ptr<private, i32, read_write> = access %tree_1, %30, 1u
%32:i32 = load %31
%33:bool = eq %32, -1i
if %33 [t: $B10, f: $B11] { # if_3
$B10: { # true
%34:i32 = load %baseIndex
%x_82:i32 = let %34
%36:ptr<private, i32, read_write> = access %tree_1, %x_82, 1u
%37:i32 = load %treeIndex
store %36, %37
%38:i32 = load %treeIndex
%x_84:i32 = let %38
%40:ptr<private, BST, read_write> = access %tree_1, %x_84
%41:BST = load %40
store %param, %41
%42:i32 = load %data_1
store %param_1, %42
%43:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1
%44:ptr<private, BST, read_write> = access %tree_1, %x_84
%45:BST = load %param
store %44, %45
ret
}
$B11: { # false
%46:i32 = load %baseIndex
%47:ptr<private, i32, read_write> = access %tree_1, %46, 1u
%48:i32 = load %47
store %baseIndex, %48
continue # -> $B5
}
}
exit_if # if_2
}
$B9: { # false
%49:i32 = load %baseIndex
%50:ptr<private, i32, read_write> = access %tree_1, %49, 2u
%51:i32 = load %50
%52:bool = eq %51, -1i
if %52 [t: $B12, f: $B13] { # if_4
$B12: { # true
%53:i32 = load %baseIndex
%x_90:i32 = let %53
%55:ptr<private, i32, read_write> = access %tree_1, %x_90, 2u
%56:i32 = load %treeIndex
store %55, %56
%57:i32 = load %treeIndex
%x_92:i32 = let %57
%59:ptr<private, BST, read_write> = access %tree_1, %x_92
%60:BST = load %59
store %param_2, %60
%61:i32 = load %data_1
store %param_3, %61
%62:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3
%63:ptr<private, BST, read_write> = access %tree_1, %x_92
%64:BST = load %param_2
store %63, %64
ret
}
$B13: { # false
store %GLF_live8i, 1i
%65:i32 = load %GLF_live8i
%66:i32 = load %GLF_live8i
%67:bool = gte %66, 0i
%68:i32 = load %GLF_live8i
%69:bool = lt %68, 50i
%70:bool = and %67, %69
%71:i32 = select 0i, %65, %70
%x_369:i32 = let %71
%73:ptr<function, f32, read_write> = access %GLF_live8A, %x_369
%74:ptr<function, f32, read_write> = access %GLF_live8A, %x_369
%75:f32 = load %74
%76:ptr<function, f32, read_write> = access %GLF_live8A, 0i
%77:f32 = load %76
%78:f32 = add %75, %77
store %73, %78
loop [b: $B14, c: $B15] { # loop_2
$B14: { # body
%79:i32 = load %baseIndex
%80:ptr<private, i32, read_write> = access %tree_1, %79, 2u
%81:i32 = load %80
store %baseIndex, %81
continue # -> $B15
}
$B15: { # continuing
%82:ptr<uniform, vec2<f32>, read> = access %x_27, 0u
%83:f32 = load_vector_element %82, 0u
%x_382:f32 = let %83
%85:ptr<uniform, vec2<f32>, read> = access %x_27, 0u
%86:f32 = load_vector_element %85, 1u
%x_384:f32 = let %86
%88:bool = gt %x_382, %x_384
%89:bool = eq %88, false
break_if %89 # -> [t: exit_loop loop_2, f: $B14]
}
}
continue # -> $B5
}
}
exit_if # if_2
}
}
unreachable
}
$B5: { # continuing
next_iteration # -> $B4
}
}
ret
}
}
%search_i1_ = func(%t:ptr<function, i32, read_write>):i32 {
$B16: {
%index:ptr<function, i32, read_write> = var
%currentNode:ptr<function, BST, read_write> = var
%x_387:ptr<function, i32, read_write> = var
store %index, 0i
loop [b: $B17, c: $B18] { # loop_3
$B17: { # body
%95:i32 = load %index
%96:bool = neq %95, -1i
if %96 [t: $B19, f: $B20] { # if_5
$B19: { # true
exit_if # if_5
}
$B20: { # false
exit_loop # loop_3
}
}
%97:i32 = load %index
%98:ptr<private, BST, read_write> = access %tree_1, %97
%99:BST = load %98
store %currentNode, %99
%100:ptr<function, i32, read_write> = access %currentNode, 0u
%101:i32 = load %100
%102:i32 = load %t
%103:bool = eq %101, %102
if %103 [t: $B21] { # if_6
$B21: { # true
%104:i32 = load %t
%x_103:i32 = let %104
ret %x_103
}
}
%106:i32 = load %t
%107:ptr<function, i32, read_write> = access %currentNode, 0u
%108:i32 = load %107
%109:bool = gt %106, %108
if %109 [t: $B22, f: $B23] { # if_7
$B22: { # true
%110:ptr<function, i32, read_write> = access %currentNode, 2u
%111:i32 = load %110
store %x_387, %111
exit_if # if_7
}
$B23: { # false
%112:ptr<function, i32, read_write> = access %currentNode, 1u
%113:i32 = load %112
store %x_387, %113
exit_if # if_7
}
}
%114:i32 = load %x_387
store %index, %114
continue # -> $B18
}
$B18: { # continuing
next_iteration # -> $B17
}
}
ret -1i
}
}
%makeFrame_f1_ = func(%v:ptr<function, f32, read_write>):f32 {
$B24: {
%param_5:ptr<function, i32, read_write> = var
%param_6:ptr<function, i32, read_write> = var
%param_7:ptr<function, i32, read_write> = var
%120:f32 = load %v
%121:f32 = mul %120, 6.5f
store %v, %121
%122:f32 = load %v
%123:bool = lt %122, 1.5f
if %123 [t: $B25] { # if_8
$B25: { # true
store %param_5, 100i
%124:i32 = call %search_i1_, %param_5
%x_110:i32 = let %124
%126:f32 = convert %x_110
ret %126
}
}
%127:f32 = load %v
%128:bool = lt %127, 4.0f
if %128 [t: $B26] { # if_9
$B26: { # true
ret 0.0f
}
}
%129:f32 = load %v
%x_429:f32 = let %129
store %param_6, 6i
%131:i32 = call %search_i1_, %param_6
%x_111:i32 = let %131
%133:f32 = convert %x_111
%134:bool = lt %x_429, %133
if %134 [t: $B27] { # if_10
$B27: { # true
ret 1.0f
}
}
store %param_7, 30i
%135:i32 = call %search_i1_, %param_7
%x_112:i32 = let %135
%137:f32 = convert %x_112
%138:f32 = add 10.0f, %137
ret %138
}
}
%hueColor_f1_ = func(%angle:ptr<function, f32, read_write>):vec3<f32> {
$B28: {
%nodeData:ptr<function, f32, read_write> = var
%param_4:ptr<function, i32, read_write> = var
store %param_4, 15i
%143:i32 = call %search_i1_, %param_4
%x_109:i32 = let %143
%145:f32 = convert %x_109
store %nodeData, %145
%146:f32 = load %angle
%x_409:f32 = let %146
%148:f32 = load %nodeData
%x_410:f32 = let %148
%150:vec3<f32> = construct 1.0f, 5.0f, %x_410
%151:vec3<f32> = mul %150, %x_409
%152:vec3<f32> = add vec3<f32>(30.0f), %151
%153:vec3<f32> = div %152, vec3<f32>(50.0f)
ret %153
}
}
%main_1 = func():void {
$B29: {
%treeIndex_1:ptr<function, i32, read_write> = var
%param_8:ptr<function, BST, read_write> = var
%param_9:ptr<function, i32, read_write> = var
%param_10:ptr<function, i32, read_write> = var
%param_11:ptr<function, i32, read_write> = var
%GLF_live1_looplimiter2:ptr<function, i32, read_write> = var
%GLF_live1i:ptr<function, i32, read_write> = var
%param_12:ptr<function, i32, read_write> = var
%param_13:ptr<function, i32, read_write> = var
%param_14:ptr<function, i32, read_write> = var
%param_15:ptr<function, i32, read_write> = var
%param_16:ptr<function, i32, read_write> = var
%param_17:ptr<function, i32, read_write> = var
%param_18:ptr<function, i32, read_write> = var
%param_19:ptr<function, i32, read_write> = var
%param_20:ptr<function, i32, read_write> = var
%param_21:ptr<function, i32, read_write> = var
%param_22:ptr<function, i32, read_write> = var
%param_23:ptr<function, i32, read_write> = var
%GLF_live4_looplimiter3:ptr<function, i32, read_write> = var
%GLF_live4i:ptr<function, i32, read_write> = var
%GLF_live4index:ptr<function, i32, read_write> = var
%GLF_live4obj:ptr<function, Obj, read_write> = var
%param_24:ptr<function, i32, read_write> = var
%param_25:ptr<function, i32, read_write> = var
%param_26:ptr<function, i32, read_write> = var
%param_27:ptr<function, i32, read_write> = var
%z:ptr<function, vec2<f32>, read_write> = var
%x:ptr<function, f32, read_write> = var
%param_28:ptr<function, f32, read_write> = var
%y:ptr<function, f32, read_write> = var
%param_29:ptr<function, f32, read_write> = var
%sum:ptr<function, i32, read_write> = var
%t_1:ptr<function, i32, read_write> = var
%result:ptr<function, i32, read_write> = var
%param_30:ptr<function, i32, read_write> = var
%a:ptr<function, f32, read_write> = var
%x_235:ptr<function, vec3<f32>, read_write> = var
%param_31:ptr<function, f32, read_write> = var
store %treeIndex_1, 0i
%194:ptr<private, BST, read_write> = access %tree_1, 0i
%195:BST = load %194
store %param_8, %195
store %param_9, 9i
%196:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_8, %param_9
%197:ptr<private, BST, read_write> = access %tree_1, 0i
%198:BST = load %param_8
store %197, %198
%199:i32 = load %treeIndex_1
%200:i32 = add %199, 1i
store %treeIndex_1, %200
%201:i32 = load %treeIndex_1
store %param_10, %201
store %param_11, 5i
%202:void = call %insert_i1_i1_, %param_10, %param_11
%203:i32 = load %treeIndex_1
%204:i32 = add %203, 1i
store %treeIndex_1, %204
store %GLF_live1_looplimiter2, 0i
store %GLF_live1i, 0i
loop [b: $B30, c: $B31] { # loop_4
$B30: { # body
if true [t: $B32, f: $B33] { # if_11
$B32: { # true
exit_if # if_11
}
$B33: { # false
exit_loop # loop_4
}
}
%205:i32 = load %GLF_live1_looplimiter2
%206:bool = gte %205, 7i
if %206 [t: $B34] { # if_12
$B34: { # true
exit_loop # loop_4
}
}
%207:i32 = load %GLF_live1_looplimiter2
%208:i32 = add %207, 1i
store %GLF_live1_looplimiter2, %208
continue # -> $B31
}
$B31: { # continuing
%209:i32 = load %GLF_live1i
%210:i32 = add %209, 1i
store %GLF_live1i, %210
next_iteration # -> $B30
}
}
%211:i32 = load %treeIndex_1
store %param_12, %211
store %param_13, 12i
%212:void = call %insert_i1_i1_, %param_12, %param_13
%213:i32 = load %treeIndex_1
%214:i32 = add %213, 1i
store %treeIndex_1, %214
%215:i32 = load %treeIndex_1
store %param_14, %215
store %param_15, 15i
%216:void = call %insert_i1_i1_, %param_14, %param_15
%217:i32 = load %treeIndex_1
%218:i32 = add %217, 1i
store %treeIndex_1, %218
%219:i32 = load %treeIndex_1
store %param_16, %219
store %param_17, 7i
%220:void = call %insert_i1_i1_, %param_16, %param_17
%221:i32 = load %treeIndex_1
%222:i32 = add %221, 1i
store %treeIndex_1, %222
%223:i32 = load %treeIndex_1
store %param_18, %223
store %param_19, 8i
%224:void = call %insert_i1_i1_, %param_18, %param_19
%225:i32 = load %treeIndex_1
%226:i32 = add %225, 1i
store %treeIndex_1, %226
%227:i32 = load %treeIndex_1
store %param_20, %227
store %param_21, 2i
%228:void = call %insert_i1_i1_, %param_20, %param_21
%229:i32 = load %treeIndex_1
%230:i32 = add %229, 1i
store %treeIndex_1, %230
%231:i32 = load %treeIndex_1
store %param_22, %231
store %param_23, 6i
%232:void = call %insert_i1_i1_, %param_22, %param_23
%233:i32 = load %treeIndex_1
%234:i32 = add %233, 1i
store %treeIndex_1, %234
store %GLF_live4_looplimiter3, 0i
store %GLF_live4i, 0i
loop [b: $B35, c: $B36] { # loop_5
$B35: { # body
if true [t: $B37, f: $B38] { # if_13
$B37: { # true
exit_if # if_13
}
$B38: { # false
exit_loop # loop_5
}
}
%235:i32 = load %GLF_live4_looplimiter3
%236:bool = gte %235, 3i
if %236 [t: $B39] { # if_14
$B39: { # true
exit_loop # loop_5
}
}
%237:i32 = load %GLF_live4_looplimiter3
%238:i32 = add %237, 1i
store %GLF_live4_looplimiter3, %238
store %GLF_live4index, 1i
%239:i32 = load %GLF_live4index
%x_144:i32 = let %239
%241:i32 = load %GLF_live4index
%x_145:i32 = let %241
%243:i32 = load %GLF_live4index
%x_146:i32 = let %243
%245:bool = gte %x_144, 0i
%246:bool = lt %x_145, 10i
%247:bool = and %245, %246
%248:i32 = select 0i, %x_146, %247
%249:ptr<function, f32, read_write> = access %GLF_live4obj, 1u, %248
%250:ptr<function, f32, read_write> = access %GLF_live4obj, 1u, 1i
%251:f32 = load %250
store %249, %251
%252:i32 = load %GLF_live4i
%x_147:i32 = let %252
%254:i32 = load %GLF_live4i
%x_148:i32 = let %254
%256:i32 = load %GLF_live4i
%x_149:i32 = let %256
%258:bool = gte %x_147, 0i
%259:bool = lt %x_148, 10i
%260:bool = and %258, %259
%261:i32 = select 0i, %x_149, %260
%262:ptr<function, f32, read_write> = access %GLF_live4obj, 1u, %261
store %262, 1.0f
continue # -> $B36
}
$B36: { # continuing
%263:i32 = load %GLF_live4i
%264:i32 = add %263, 1i
store %GLF_live4i, %264
next_iteration # -> $B35
}
}
%265:i32 = load %treeIndex_1
store %param_24, %265
store %param_25, 17i
%266:void = call %insert_i1_i1_, %param_24, %param_25
%267:ptr<uniform, vec2<f32>, read> = access %x_27, 0u
%268:f32 = load_vector_element %267, 0u
%269:ptr<uniform, vec2<f32>, read> = access %x_27, 0u
%270:f32 = load_vector_element %269, 1u
%271:bool = gt %268, %270
if %271 [t: $B40] { # if_15
$B40: { # true
ret
}
}
%272:i32 = load %treeIndex_1
%273:i32 = add %272, 1i
store %treeIndex_1, %273
%274:i32 = load %treeIndex_1
store %param_26, %274
store %param_27, 13i
%275:void = call %insert_i1_i1_, %param_26, %param_27
%276:vec4<f32> = load %gl_FragCoord
%277:vec2<f32> = swizzle %276, yx
%278:vec2<f32> = div %277, vec2<f32>(256.0f)
store %z, %278
%279:f32 = load_vector_element %z, 0u
store %param_28, %279
%280:f32 = call %makeFrame_f1_, %param_28
%x_290:f32 = let %280
store %x, %x_290
%282:f32 = load_vector_element %z, 1u
store %param_29, %282
%283:f32 = call %makeFrame_f1_, %param_29
%x_293:f32 = let %283
store %y, %x_293
store %sum, -100i
store %t_1, 0i
loop [b: $B41, c: $B42] { # loop_6
$B41: { # body
%285:i32 = load %t_1
%286:bool = lt %285, 20i
if %286 [t: $B43, f: $B44] { # if_16
$B43: { # true
exit_if # if_16
}
$B44: { # false
exit_loop # loop_6
}
}
%287:i32 = load %t_1
store %param_30, %287
%288:i32 = call %search_i1_, %param_30
%x_158:i32 = let %288
store %result, %x_158
%290:i32 = load %result
%291:bool = gt %290, 0i
if %291 [t: $B45, f: $B46] { # if_17
$B45: { # true
exit_if # if_17
}
$B46: { # false
%292:i32 = load %result
%x_160:i32 = let %292
switch %x_160 [c: (0i, $B47), c: (-1i, $B48), c: (default, $B49)] { # switch_1
$B47: { # case
ret
}
$B48: { # case
%294:i32 = load %sum
%295:i32 = add %294, 1i
store %sum, %295
exit_switch # switch_1
}
$B49: { # case
exit_switch # switch_1
}
}
exit_if # if_17
}
}
continue # -> $B42
}
$B42: { # continuing
%296:i32 = load %t_1
%297:i32 = add %296, 1i
store %t_1, %297
next_iteration # -> $B41
}
}
%298:f32 = load %x
%299:f32 = let %298
%300:f32 = load %y
%301:f32 = let %300
%302:i32 = load %sum
%303:f32 = convert %302
%304:f32 = mul %301, %303
%305:f32 = add %299, %304
store %a, %305
%306:ptr<uniform, vec2<f32>, read> = access %x_27, 0u
%307:f32 = load_vector_element %306, 0u
%308:ptr<uniform, vec2<f32>, read> = access %x_27, 0u
%309:f32 = load_vector_element %308, 1u
%310:bool = lt %307, %309
if %310 [t: $B50, f: $B51] { # if_18
$B50: { # true
store %x_235, vec3<f32>(1.0f, 0.0f, 0.0f)
exit_if # if_18
}
$B51: { # false
%311:f32 = load %a
store %param_31, %311
%312:vec3<f32> = call %hueColor_f1_, %param_31
%x_321:vec3<f32> = let %312
store %x_235, %x_321
exit_if # if_18
}
}
%314:f32 = load_vector_element %x_235, 0u
%315:f32 = load_vector_element %x_235, 1u
%316:f32 = load_vector_element %x_235, 2u
%317:vec4<f32> = construct %314, %315, %316, 1.0f
store %x_GLF_color, %317
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B52: {
store %gl_FragCoord, %gl_FragCoord_param
%320:void = call %main_1
%321:vec4<f32> = load %x_GLF_color
%322:main_out = construct %321
ret %322
}
}
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. *
********************************************************************