blob: 8c53e969af12e4234102262424e9260fb06ba762 [file] [log] [blame]
SKIP: FAILED
<dawn>/src/tint/lang/msl/writer/printer/printer.cc:355 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)
}
main_out = struct @align(16) {
x_GLF_color_1:vec4<f32> @offset(0), @location(0)
}
%b1 = block { # root
%tree_1:ptr<private, array<BST, 10>, read_write> = var
%x_16:ptr<uniform, buf0, read> = var @binding_point(0, 0)
%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 {
%b2 = block {
%x_165:i32 = load %data
%8:ptr<function, i32, read_write> = access %tree, 0u
store %8, %x_165
%9:ptr<function, i32, read_write> = access %tree, 1u
store %9, -1i
%10:ptr<function, i32, read_write> = access %tree, 2u
store %10, -1i
ret
}
}
%insert_i1_i1_ = func(%treeIndex:ptr<function, i32, read_write>, %data_1:ptr<function, i32, read_write>):void -> %b3 {
%b3 = block {
%baseIndex:ptr<function, i32, read_write> = var
%param:ptr<function, BST, read_write> = var
%param_1:ptr<function, i32, read_write> = var
%x_170:ptr<function, i32, read_write> = var
%param_2:ptr<function, BST, read_write> = var
%param_3:ptr<function, i32, read_write> = var
store %baseIndex, 0i
loop [b: %b4, c: %b5] { # loop_1
%b4 = block { # body
%x_175:i32 = load %baseIndex
%x_176:i32 = load %treeIndex
%22:bool = lte %x_175, %x_176
if %22 [t: %b6, f: %b7] { # if_1
%b6 = block { # true
exit_if # if_1
}
%b7 = block { # false
exit_loop # loop_1
}
}
%x_179:i32 = load %data_1
%x_180:i32 = load %baseIndex
%25:ptr<private, i32, read_write> = access %tree_1, %x_180, 0u
%x_182:i32 = load %25
%27:bool = lte %x_179, %x_182
if %27 [t: %b8, f: %b9] { # if_2
%b8 = block { # true
%x_187:i32 = load %baseIndex
%29:ptr<private, i32, read_write> = access %tree_1, %x_187, 1u
%x_189:i32 = load %29
%31:bool = eq %x_189, -1i
if %31 [t: %b10, f: %b11] { # if_3
%b10 = block { # true
%x_194:i32 = load %baseIndex
%x_195:i32 = load %treeIndex
%34:ptr<private, i32, read_write> = access %tree_1, %x_194, 1u
store %34, %x_195
%35:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_198:f32 = load_vector_element %35, 0u
%37:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_200:f32 = load_vector_element %37, 1u
%39:bool = lt %x_198, %x_200
if %39 [t: %b12] { # if_4
%b12 = block { # true
%x_204:i32 = load %treeIndex
%41:ptr<private, BST, read_write> = access %tree_1, %x_204
%x_206:BST = load %41
store %param, %x_206
%x_207:i32 = load %data_1
store %param_1, %x_207
%44:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1
%x_209:BST = load %param
%46:ptr<private, BST, read_write> = access %tree_1, %x_204
store %46, %x_209
exit_if # if_4
}
}
%47:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_212:f32 = load_vector_element %47, 0u
%49:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_214:f32 = load_vector_element %49, 1u
%51:bool = lt %x_212, %x_214
if %51 [t: %b13] { # if_5
%b13 = block { # true
ret
}
}
exit_if # if_3
}
%b11 = block { # false
%x_218:i32 = load %baseIndex
%53:ptr<private, i32, read_write> = access %tree_1, %x_218, 1u
%x_220:i32 = load %53
store %baseIndex, %x_220
continue %b5
}
}
exit_if # if_2
}
%b9 = block { # false
%55:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_222:f32 = load_vector_element %55, 0u
%57:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_224:f32 = load_vector_element %57, 1u
%59:bool = lt %x_222, %x_224
if %59 [t: %b14, f: %b15] { # if_6
%b14 = block { # true
%x_229:i32 = load %baseIndex
%61:ptr<private, i32, read_write> = access %tree_1, %x_229, 2u
%x_231:i32 = load %61
store %x_170, %x_231
exit_if # if_6
}
%b15 = block { # false
%x_232:i32 = load %baseIndex
%64:ptr<private, i32, read_write> = access %tree_1, %x_232, 2u
%x_234:i32 = load %64
store %x_170, %x_234
exit_if # if_6
}
}
%x_235:i32 = load %x_170
%67:bool = eq %x_235, -1i
if %67 [t: %b16, f: %b17] { # if_7
%b16 = block { # true
%x_240:i32 = load %baseIndex
%x_241:i32 = load %treeIndex
%70:ptr<private, i32, read_write> = access %tree_1, %x_240, 2u
store %70, %x_241
%x_243:i32 = load %treeIndex
%72:ptr<private, BST, read_write> = access %tree_1, %x_243
%x_245:BST = load %72
store %param_2, %x_245
%x_246:i32 = load %data_1
store %param_3, %x_246
%75:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3
%x_248:BST = load %param_2
%77:ptr<private, BST, read_write> = access %tree_1, %x_243
store %77, %x_248
ret
}
%b17 = block { # false
%x_250:i32 = load %baseIndex
%79:ptr<private, i32, read_write> = access %tree_1, %x_250, 2u
%x_252:i32 = load %79
store %baseIndex, %x_252
continue %b5
}
}
exit_if # if_2
}
}
%81:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_254:f32 = load_vector_element %81, 0u
%83:ptr<uniform, vec2<f32>, read> = access %x_16, 0u
%x_256:f32 = load_vector_element %83, 1u
%85:bool = gt %x_254, %x_256
if %85 [t: %b18] { # if_8
%b18 = block { # true
ret
}
}
continue %b5
}
%b5 = block { # continuing
next_iteration %b4
}
}
ret
}
}
%search_i1_ = func(%t:ptr<function, i32, read_write>):i32 -> %b19 {
%b19 = block {
%index:ptr<function, i32, read_write> = var
%currentNode:ptr<function, BST, read_write> = var
%x_261:ptr<function, i32, read_write> = var
store %index, 0i
loop [b: %b20, c: %b21] { # loop_2
%b20 = block { # body
%x_266:i32 = load %index
%92:bool = neq %x_266, -1i
if %92 [t: %b22, f: %b23] { # if_9
%b22 = block { # true
exit_if # if_9
}
%b23 = block { # false
exit_loop # loop_2
}
}
%x_269:i32 = load %index
%94:ptr<private, BST, read_write> = access %tree_1, %x_269
%x_271:BST = load %94
store %currentNode, %x_271
%96:ptr<function, i32, read_write> = access %currentNode, 0u
%x_273:i32 = load %96
%x_274:i32 = load %t
%99:bool = eq %x_273, %x_274
if %99 [t: %b24] { # if_10
%b24 = block { # true
%x_278:i32 = load %t
ret %x_278
}
}
%x_279:i32 = load %t
%102:ptr<function, i32, read_write> = access %currentNode, 0u
%x_281:i32 = load %102
%104:bool = gt %x_279, %x_281
if %104 [t: %b25, f: %b26] { # if_11
%b25 = block { # true
%105:ptr<function, i32, read_write> = access %currentNode, 2u
%x_287:i32 = load %105
store %x_261, %x_287
exit_if # if_11
}
%b26 = block { # false
%107:ptr<function, i32, read_write> = access %currentNode, 1u
%x_289:i32 = load %107
store %x_261, %x_289
exit_if # if_11
}
}
%x_290:i32 = load %x_261
store %index, %x_290
continue %b21
}
%b21 = block { # continuing
next_iteration %b20
}
}
ret -1i
}
}
%main_1 = func():void -> %b27 {
%b27 = block {
%treeIndex_1:ptr<function, i32, read_write> = var
%param_4:ptr<function, BST, read_write> = var
%param_5:ptr<function, i32, read_write> = var
%param_6:ptr<function, i32, read_write> = var
%param_7:ptr<function, i32, read_write> = var
%param_8:ptr<function, i32, 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
%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
%count:ptr<function, i32, read_write> = var
%i:ptr<function, i32, read_write> = var
%result:ptr<function, i32, read_write> = var
%param_24:ptr<function, i32, read_write> = var
store %treeIndex_1, 0i
%136:ptr<private, BST, read_write> = access %tree_1, 0i
%x_91:BST = load %136
store %param_4, %x_91
store %param_5, 9i
%138:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_4, %param_5
%x_93:BST = load %param_4
%140:ptr<private, BST, read_write> = access %tree_1, 0i
store %140, %x_93
%x_95:i32 = load %treeIndex_1
%142:i32 = add %x_95, 1i
store %treeIndex_1, %142
%x_97:i32 = load %treeIndex_1
store %param_6, %x_97
store %param_7, 5i
%144:void = call %insert_i1_i1_, %param_6, %param_7
%x_99:i32 = load %treeIndex_1
%146:i32 = add %x_99, 1i
store %treeIndex_1, %146
%x_101:i32 = load %treeIndex_1
store %param_8, %x_101
store %param_9, 12i
%148:void = call %insert_i1_i1_, %param_8, %param_9
%x_103:i32 = load %treeIndex_1
%150:i32 = add %x_103, 1i
store %treeIndex_1, %150
%x_105:i32 = load %treeIndex_1
store %param_10, %x_105
store %param_11, 15i
%152:void = call %insert_i1_i1_, %param_10, %param_11
%x_107:i32 = load %treeIndex_1
%154:i32 = add %x_107, 1i
store %treeIndex_1, %154
%x_109:i32 = load %treeIndex_1
store %param_12, %x_109
store %param_13, 7i
%156:void = call %insert_i1_i1_, %param_12, %param_13
%x_111:i32 = load %treeIndex_1
%158:i32 = add %x_111, 1i
store %treeIndex_1, %158
%x_113:i32 = load %treeIndex_1
store %param_14, %x_113
store %param_15, 8i
%160:void = call %insert_i1_i1_, %param_14, %param_15
%x_115:i32 = load %treeIndex_1
%162:i32 = add %x_115, 1i
store %treeIndex_1, %162
%x_117:i32 = load %treeIndex_1
store %param_16, %x_117
store %param_17, 2i
%164:void = call %insert_i1_i1_, %param_16, %param_17
%x_119:i32 = load %treeIndex_1
%166:i32 = add %x_119, 1i
store %treeIndex_1, %166
%x_121:i32 = load %treeIndex_1
store %param_18, %x_121
store %param_19, 6i
%168:void = call %insert_i1_i1_, %param_18, %param_19
%x_123:i32 = load %treeIndex_1
%170:i32 = add %x_123, 1i
store %treeIndex_1, %170
%x_125:i32 = load %treeIndex_1
store %param_20, %x_125
store %param_21, 17i
%172:void = call %insert_i1_i1_, %param_20, %param_21
%x_127:i32 = load %treeIndex_1
%174:i32 = add %x_127, 1i
store %treeIndex_1, %174
%x_129:i32 = load %treeIndex_1
store %param_22, %x_129
store %param_23, 13i
%176:void = call %insert_i1_i1_, %param_22, %param_23
store %count, 0i
store %i, 0i
loop [b: %b28, c: %b29] { # loop_3
%b28 = block { # body
%x_135:i32 = load %i
%178:bool = lt %x_135, 20i
if %178 [t: %b30, f: %b31] { # if_12
%b30 = block { # true
exit_if # if_12
}
%b31 = block { # false
exit_loop # loop_3
}
}
%x_138:i32 = load %i
store %param_24, %x_138
%x_139:i32 = call %search_i1_, %param_24
store %result, %x_139
%x_140:i32 = load %i
switch %x_140 [c: (2i 5i 6i 7i 8i 9i 12i 13i 15i 17i, %b32), c: (default, %b33)] { # switch_1
%b32 = block { # case
%x_150:i32 = load %result
%x_151:i32 = load %i
%184:bool = eq %x_150, %x_151
if %184 [t: %b34] { # if_13
%b34 = block { # true
%x_155:i32 = load %count
%186:i32 = add %x_155, 1i
store %count, %186
exit_if # if_13
}
}
exit_switch # switch_1
}
%b33 = block { # case
%x_144:i32 = load %result
%188:bool = eq %x_144, -1i
if %188 [t: %b35] { # if_14
%b35 = block { # true
%x_148:i32 = load %count
%190:i32 = add %x_148, 1i
store %count, %190
exit_if # if_14
}
}
exit_switch # switch_1
}
}
continue %b29
}
%b29 = block { # continuing
%x_157:i32 = load %i
%192:i32 = add %x_157, 1i
store %i, %192
next_iteration %b28
}
}
%x_159:i32 = load %count
%194:bool = eq %x_159, 20i
if %194 [t: %b36, f: %b37] { # if_15
%b36 = block { # true
store %x_GLF_color, vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f)
exit_if # if_15
}
%b37 = block { # false
store %x_GLF_color, vec4<f32>(0.0f, 0.0f, 1.0f, 1.0f)
exit_if # if_15
}
}
ret
}
}
%tint_symbol = @fragment func():main_out -> %b38 {
%b38 = block {
%196:void = call %main_1
%197:vec4<f32> = load %x_GLF_color
%198:main_out = construct %197
ret %198
}
}
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. *
********************************************************************