blob: 21e6e741745a21c458e9f1054425a6c994b3d1b7 [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: QuicksortObject = struct @align(4) {
numbers:array<i32, 10> @offset(0)
}
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: { # root
%obj:ptr<private, QuicksortObject, read_write> = var
%tree:ptr<private, array<BST, 10>, read_write> = var
%x_50: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(%node:ptr<function, BST, read_write>, %data:ptr<function, i32, read_write>):void {
$B2: {
%8:ptr<function, i32, read_write> = access %node, 0u
%9:i32 = load %data
store %8, %9
%10:ptr<function, i32, read_write> = access %node, 1u
store %10, -1i
%11:ptr<function, i32, read_write> = access %node, 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
store %baseIndex, 0i
loop [b: $B4, c: $B5] { # loop_1
$B4: { # body
%20:i32 = load %baseIndex
%21:i32 = load %treeIndex
%22:bool = lte %20, %21
if %22 [t: $B6, f: $B7] { # if_1
$B6: { # true
exit_if # if_1
}
$B7: { # false
exit_loop # loop_1
}
}
%23:i32 = load %data_1
%24:i32 = load %baseIndex
%25:ptr<private, i32, read_write> = access %tree, %24, 0u
%26:i32 = load %25
%27:bool = lte %23, %26
if %27 [t: $B8, f: $B9] { # if_2
$B8: { # true
%28:i32 = load %baseIndex
%29:ptr<private, i32, read_write> = access %tree, %28, 1u
%30:i32 = load %29
%31:bool = eq %30, -1i
if %31 [t: $B10, f: $B11] { # if_3
$B10: { # true
%32:i32 = load %baseIndex
%x_236:i32 = let %32
%34:ptr<private, i32, read_write> = access %tree, %x_236, 1u
%35:i32 = load %treeIndex
store %34, %35
%36:i32 = load %treeIndex
%x_239:i32 = let %36
%38:ptr<private, BST, read_write> = access %tree, %x_239
%39:BST = load %38
store %param, %39
%40:i32 = load %data_1
store %param_1, %40
%41:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param, %param_1
%42:ptr<private, BST, read_write> = access %tree, %x_239
%43:BST = load %param
store %42, %43
ret
}
$B11: { # false
%44:i32 = load %baseIndex
%45:ptr<private, i32, read_write> = access %tree, %44, 1u
%46:i32 = load %45
store %baseIndex, %46
continue # -> $B5
}
}
exit_if # if_2
}
$B9: { # false
%47:i32 = load %baseIndex
%48:ptr<private, i32, read_write> = access %tree, %47, 2u
%49:i32 = load %48
%50:bool = eq %49, -1i
if %50 [t: $B12, f: $B13] { # if_4
$B12: { # true
%51:i32 = load %baseIndex
%x_256:i32 = let %51
%53:ptr<private, i32, read_write> = access %tree, %x_256, 2u
%54:i32 = load %treeIndex
store %53, %54
%55:i32 = load %treeIndex
%x_259:i32 = let %55
%57:ptr<private, BST, read_write> = access %tree, %x_259
%58:BST = load %57
store %param_2, %58
%59:i32 = load %data_1
store %param_3, %59
%60:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_2, %param_3
%61:ptr<private, BST, read_write> = access %tree, %x_259
%62:BST = load %param_2
store %61, %62
ret
}
$B13: { # false
%63:i32 = load %baseIndex
%64:ptr<private, i32, read_write> = access %tree, %63, 2u
%65:i32 = load %64
store %baseIndex, %65
continue # -> $B5
}
}
exit_if # if_2
}
}
unreachable
}
$B5: { # continuing
next_iteration # -> $B4
}
}
ret
}
}
%identity_i1_ = func(%a:ptr<function, i32, read_write>):i32 {
$B14: {
%68:i32 = load %a
%x_202:i32 = let %68
%70:ptr<private, i32, read_write> = access %obj, 0u, %x_202
%71:i32 = load %a
store %70, %71
%72:ptr<private, i32, read_write> = access %obj, 0u, 2i
%73:i32 = load %72
%x_206:i32 = let %73
ret %x_206
}
}
%search_i1_ = func(%t:ptr<function, i32, read_write>):i32 {
$B15: {
%index:ptr<function, i32, read_write> = var
%currentNode:ptr<function, BST, read_write> = var
%x_270:ptr<function, i32, read_write> = var
store %index, 0i
loop [b: $B16, c: $B17] { # loop_2
$B16: { # body
%80:i32 = load %index
%81:bool = neq %80, -1i
if %81 [t: $B18, f: $B19] { # if_5
$B18: { # true
exit_if # if_5
}
$B19: { # false
exit_loop # loop_2
}
}
%82:i32 = load %index
%83:ptr<private, BST, read_write> = access %tree, %82
%84:BST = load %83
store %currentNode, %84
%85:ptr<function, i32, read_write> = access %currentNode, 0u
%86:i32 = load %85
%87:i32 = load %t
%88:bool = eq %86, %87
if %88 [t: $B20] { # if_6
$B20: { # true
%89:i32 = load %t
%x_287:i32 = let %89
ret %x_287
}
}
%91:i32 = load %t
%92:ptr<function, i32, read_write> = access %currentNode, 0u
%93:i32 = load %92
%94:bool = gt %91, %93
if %94 [t: $B21, f: $B22] { # if_7
$B21: { # true
%95:ptr<function, i32, read_write> = access %currentNode, 2u
%96:i32 = load %95
store %x_270, %96
exit_if # if_7
}
$B22: { # false
%97:ptr<function, i32, read_write> = access %currentNode, 1u
%98:i32 = load %97
store %x_270, %98
exit_if # if_7
}
}
%99:i32 = load %x_270
store %index, %99
continue # -> $B17
}
$B17: { # continuing
next_iteration # -> $B16
}
}
ret -1i
}
}
%main_1 = func():void {
$B23: {
%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
%pp:ptr<function, i32, read_write> = var
%looplimiter0:ptr<function, i32, read_write> = var
%i:ptr<function, i32, read_write> = var
%param_24:ptr<function, i32, read_write> = var
%count:ptr<function, i32, read_write> = var
%i_1:ptr<function, i32, read_write> = var
%result:ptr<function, i32, read_write> = var
%param_25:ptr<function, i32, read_write> = var
store %treeIndex_1, 0i
%130:ptr<private, BST, read_write> = access %tree, 0i
%131:BST = load %130
store %param_4, %131
store %param_5, 9i
%132:void = call %makeTreeNode_struct_BST_i1_i1_i11_i1_, %param_4, %param_5
%133:ptr<private, BST, read_write> = access %tree, 0i
%134:BST = load %param_4
store %133, %134
%135:i32 = load %treeIndex_1
%136:i32 = add %135, 1i
store %treeIndex_1, %136
%137:i32 = load %treeIndex_1
store %param_6, %137
store %param_7, 5i
%138:void = call %insert_i1_i1_, %param_6, %param_7
%139:i32 = load %treeIndex_1
%140:i32 = add %139, 1i
store %treeIndex_1, %140
%141:i32 = load %treeIndex_1
store %param_8, %141
store %param_9, 12i
%142:void = call %insert_i1_i1_, %param_8, %param_9
%143:i32 = load %treeIndex_1
%144:i32 = add %143, 1i
store %treeIndex_1, %144
%145:i32 = load %treeIndex_1
store %param_10, %145
store %param_11, 15i
%146:void = call %insert_i1_i1_, %param_10, %param_11
%147:i32 = load %treeIndex_1
%148:i32 = add %147, 1i
store %treeIndex_1, %148
%149:i32 = load %treeIndex_1
store %param_12, %149
store %param_13, 7i
%150:void = call %insert_i1_i1_, %param_12, %param_13
%151:i32 = load %treeIndex_1
%152:i32 = add %151, 1i
store %treeIndex_1, %152
%153:i32 = load %treeIndex_1
store %param_14, %153
store %param_15, 8i
%154:void = call %insert_i1_i1_, %param_14, %param_15
%155:i32 = load %treeIndex_1
%156:i32 = add %155, 1i
store %treeIndex_1, %156
%157:i32 = load %treeIndex_1
store %param_16, %157
store %param_17, 2i
%158:void = call %insert_i1_i1_, %param_16, %param_17
%159:i32 = load %treeIndex_1
%160:i32 = add %159, 1i
store %treeIndex_1, %160
%161:i32 = load %treeIndex_1
store %param_18, %161
store %param_19, 6i
%162:void = call %insert_i1_i1_, %param_18, %param_19
%163:i32 = load %treeIndex_1
%164:i32 = add %163, 1i
store %treeIndex_1, %164
%165:i32 = load %treeIndex_1
store %param_20, %165
store %param_21, 17i
%166:void = call %insert_i1_i1_, %param_20, %param_21
%167:i32 = load %treeIndex_1
%168:i32 = add %167, 1i
store %treeIndex_1, %168
%169:i32 = load %treeIndex_1
store %param_22, %169
store %param_23, 13i
%170:void = call %insert_i1_i1_, %param_22, %param_23
store %pp, 0i
store %looplimiter0, 0i
store %i, 0i
loop [b: $B24, c: $B25] { # loop_3
$B24: { # body
%171:i32 = load %i
%172:bool = lt %171, 10000i
if %172 [t: $B26, f: $B27] { # if_8
$B26: { # true
exit_if # if_8
}
$B27: { # false
exit_loop # loop_3
}
}
%173:i32 = load %looplimiter0
%174:i32 = let %173
%175:ptr<uniform, vec2<f32>, read> = access %x_50, 0u
%176:f32 = load_vector_element %175, 1u
%177:i32 = call %tint_f32_to_i32, %176
%179:bool = gte %174, %177
if %179 [t: $B28] { # if_9
$B28: { # true
%180:ptr<uniform, vec2<f32>, read> = access %x_50, 0u
%181:f32 = load_vector_element %180, 1u
%182:i32 = call %tint_f32_to_i32, %181
%183:i32 = add 1i, %182
store %param_24, %183
%184:i32 = call %identity_i1_, %param_24
%x_159:i32 = let %184
store %pp, %x_159
exit_loop # loop_3
}
}
%186:i32 = load %looplimiter0
%187:i32 = add %186, 1i
store %looplimiter0, %187
continue # -> $B25
}
$B25: { # continuing
%188:i32 = load %i
%189:i32 = add %188, 1i
store %i, %189
next_iteration # -> $B24
}
}
%190:i32 = load %pp
%191:bool = neq %190, 2i
if %191 [t: $B29] { # if_10
$B29: { # true
ret
}
}
store %count, 0i
store %i_1, 0i
loop [b: $B30, c: $B31] { # loop_4
$B30: { # body
%192:i32 = load %i_1
%193:bool = lt %192, 20i
if %193 [t: $B32, f: $B33] { # if_11
$B32: { # true
exit_if # if_11
}
$B33: { # false
exit_loop # loop_4
}
}
%194:i32 = load %i_1
store %param_25, %194
%195:i32 = call %search_i1_, %param_25
%x_176:i32 = let %195
store %result, %x_176
%197:i32 = load %i_1
%x_177:i32 = let %197
switch %x_177 [c: (2i 5i 6i 7i 8i 9i 12i 13i 15i 17i, $B34), c: (default, $B35)] { # switch_1
$B34: { # case
%199:i32 = load %result
%200:i32 = load %i_1
%201:bool = eq %199, %200
if %201 [t: $B36] { # if_12
$B36: { # true
%202:i32 = load %count
%203:i32 = add %202, 1i
store %count, %203
exit_if # if_12
}
}
exit_switch # switch_1
}
$B35: { # case
%204:i32 = load %result
%205:bool = eq %204, -1i
if %205 [t: $B37] { # if_13
$B37: { # true
%206:i32 = load %count
%207:i32 = add %206, 1i
store %count, %207
exit_if # if_13
}
}
exit_switch # switch_1
}
}
continue # -> $B31
}
$B31: { # continuing
%208:i32 = load %i_1
%209:i32 = add %208, 1i
store %i_1, %209
next_iteration # -> $B30
}
}
%210:i32 = load %count
%211:bool = eq %210, 20i
if %211 [t: $B38, f: $B39] { # if_14
$B38: { # true
store %x_GLF_color, vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f)
exit_if # if_14
}
$B39: { # false
store %x_GLF_color, vec4<f32>(0.0f, 0.0f, 1.0f, 1.0f)
exit_if # if_14
}
}
ret
}
}
%tint_symbol = @fragment func():main_out {
$B40: {
%213:void = call %main_1
%214:vec4<f32> = load %x_GLF_color
%215:main_out = construct %214
ret %215
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B41: {
%217:i32 = convert %value
%218:bool = gte %value, -2147483648.0f
%219:i32 = select -2147483648i, %217, %218
%220:bool = lte %value, 2147483520.0f
%221:i32 = select 2147483647i, %219, %220
ret %221
}
}
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. *
********************************************************************