Results 1 to 1 of 1

Thread: Too many function calls breaks compute shader

  1. #1
    Junior Member
    Join Date
    Feb 2017
    Posts
    7

    Too many function calls breaks compute shader

    I have two spirv compute shaders: one which compiles and one which causes a segfault during pipeline creation. These two compute shaders are virtually identical, except that the broken shader performs one extra function call. The extra function call does not add any cfg edges to functions that were not previously called in the program. I have tested this across both nvidia and amd gpus, and I see very similar behavior, with the main difference being the number of function calls that break the driver differ. Below is a diff of the disassembled shaders along with the full disassembly for each shader. For these two specific shaders, I have been testing against an nvidia GM204M with driver version 396.45-2 with archlinux on x86_64.

    Any help is greatly appreciated. Thanks!

    DIFF (LEFT = WORKING SHADER, RIGHT = BROKEN SHADER)
    Note that besides some differing ids the only real difference is the extra OpFunctionCall.
    Code :
    4c4
    < ; Bound: 654
    ---
    > ; Bound: 655
    9,10c9,10
    <                OpEntryPoint GLCompute %639 "main" %global_invocation
    <                OpExecutionMode %639 LocalSize 1 1 1
    ---
    >                OpEntryPoint GLCompute %640 "main" %global_invocation
    >                OpExecutionMode %640 LocalSize 1 1 1
    162a163
    >                OpName %fn_return_22 "fn_return_22"
    178c179
    <                OpName %fn_return_48 "fn_return_48"
    ---
    >                OpName %fn_return_49 "fn_return_49"
    388a390
    > %fn_return_22 = OpFunctionCall %void %field_square_private_private_private %global_5 %global_5
    398c400
    <         %639 = OpFunction %void None %fn_11
    ---
    >         %640 = OpFunction %void None %fn_11
    412c414
    < %fn_return_48 = OpFunctionCall %void %curve_double %global_2 %global_1
    ---
    > %fn_return_49 = OpFunctionCall %void %curve_double %global_2 %global_1

    WORKING SHADER
    Code :
    ; SPIR-V
    ; Version: 1.3
    ; Generator: Khronos; 64222
    ; Bound: 654
    ; Schema: 0
                   OpCapability Shader
                   OpExtension "SPV_KHR_storage_buffer_storage_class"
                   OpMemoryModel Logical Simple
                   OpEntryPoint GLCompute %639 "main" %global_invocation
                   OpExecutionMode %639 LocalSize 1 1 1
                   OpName %u32 "u32"
                   OpName %c_u32_24 "c_u32_24"
                   OpName %u32_array "u32_array"
                   OpName %struct "struct"
                   OpName %private_struct_ptr "private_struct_ptr"
                   OpName %global "global"
                   OpName %global_0 "global_0"
                   OpName %vector "vector"
                   OpName %input_vector_ptr "input_vector_ptr"
                   OpName %global_invocation "global_invocation"
                   OpName %struct_0 "struct_0"
                   OpName %struct_runtime_array "struct_runtime_array"
                   OpName %storage_buffer_struct_runtime_array "storage_buffer_struct_runtime_array"
                   OpName %storage_buffer_storage_buffer_struct_runtime_array_ptr "storage_buffer_storage_buffer_struct_runtime_array_ptr"
                   OpName %descriptor_set_0_0 "descriptor_set_0_0"
                   OpName %descriptor_set_0_1 "descriptor_set_0_1"
                   OpName %storage_buffer_struct "storage_buffer_struct"
                   OpName %storage_buffer_storage_buffer_struct_ptr "storage_buffer_storage_buffer_struct_ptr"
                   OpName %descriptor_set_0_2 "descriptor_set_0_2"
                   OpName %descriptor_set_0_3 "descriptor_set_0_3"
                   OpName %private_struct_ptr_0 "private_struct_ptr_0"
                   OpName %global_1 "global_1"
                   OpName %global_2 "global_2"
                   OpName %c_u32_0 "c_u32_0"
                   OpName %c_u32_1 "c_u32_1"
                   OpName %bool "bool"
                   OpName %function_u32_ptr "function_u32_ptr"
                   OpName %private_u32_array_ptr "private_u32_array_ptr"
                   OpName %private_u32_ptr "private_u32_ptr"
                   OpName %struct_1 "struct_1"
                   OpName %c_u32_2 "c_u32_2"
                   OpName %bignum_add_private_private_private_arg_0 "bignum_add_private_private_private_arg_0"
                   OpName %bignum_add_private_private_private_arg_1 "bignum_add_private_private_private_arg_1"
                   OpName %bignum_add_private_private_private_arg_2 "bignum_add_private_private_private_arg_2"
                   OpName %bignum_add_private_private_private_var_0 "bignum_add_private_private_private_var_0"
                   OpName %bignum_add_private_private_private_var_1 "bignum_add_private_private_private_var_1"
                   OpName %fn_3 "fn_3"
                   OpName %bignum_add_private_private_private "bignum_add_private_private_private"
                   OpName %fn_start_3 "fn_start_3"
                   OpName %anonymous_143 "anonymous_143"
                   OpName %anonymous_144 "anonymous_144"
                   OpName %anonymous_145 "anonymous_145"
                   OpName %anonymous_146 "anonymous_146"
                   OpName %loop_header_2 "loop_header_2"
                   OpName %loop_merge_2 "loop_merge_2"
                   OpName %loop_body_2 "loop_body_2"
                   OpName %loop_continue_2 "loop_continue_2"
                   OpName %loop_after_2 "loop_after_2"
                   OpName %var_6 "var_6"
                   OpName %var_7 "var_7"
                   OpName %cond_2 "cond_2"
                   OpName %x_ptr "x_ptr"
                   OpName %x "x"
                   OpName %y_ptr "y_ptr"
                   OpName %y "y"
                   OpName %anonymous_147 "anonymous_147"
                   OpName %anonymous_148 "anonymous_148"
                   OpName %anonymous_149 "anonymous_149"
                   OpName %carry "carry"
                   OpName %anonymous_150 "anonymous_150"
                   OpName %anonymous_151 "anonymous_151"
                   OpName %anonymous_152 "anonymous_152"
                   OpName %anonymous_153 "anonymous_153"
                   OpName %r_ptr "r_ptr"
                   OpName %return_carry "return_carry"
                   OpName %bignum_sub_private_private_private_arg_0 "bignum_sub_private_private_private_arg_0"
                   OpName %bignum_sub_private_private_private_arg_1 "bignum_sub_private_private_private_arg_1"
                   OpName %bignum_sub_private_private_private_arg_2 "bignum_sub_private_private_private_arg_2"
                   OpName %bignum_sub_private_private_private_var_0 "bignum_sub_private_private_private_var_0"
                   OpName %bignum_sub_private_private_private_var_1 "bignum_sub_private_private_private_var_1"
                   OpName %bignum_sub_private_private_private "bignum_sub_private_private_private"
                   OpName %fn_start_4 "fn_start_4"
                   OpName %anonymous_154 "anonymous_154"
                   OpName %anonymous_155 "anonymous_155"
                   OpName %anonymous_156 "anonymous_156"
                   OpName %anonymous_157 "anonymous_157"
                   OpName %loop_header_3 "loop_header_3"
                   OpName %loop_merge_3 "loop_merge_3"
                   OpName %loop_body_3 "loop_body_3"
                   OpName %loop_continue_3 "loop_continue_3"
                   OpName %loop_after_3 "loop_after_3"
                   OpName %var_8 "var_8"
                   OpName %var_9 "var_9"
                   OpName %cond_3 "cond_3"
                   OpName %x_ptr_0 "x_ptr_0"
                   OpName %x_0 "x_0"
                   OpName %y_ptr_0 "y_ptr_0"
                   OpName %y_0 "y_0"
                   OpName %anonymous_158 "anonymous_158"
                   OpName %anonymous_159 "anonymous_159"
                   OpName %anonymous_160 "anonymous_160"
                   OpName %borrow "borrow"
                   OpName %anonymous_161 "anonymous_161"
                   OpName %anonymous_162 "anonymous_162"
                   OpName %anonymous_163 "anonymous_163"
                   OpName %anonymous_164 "anonymous_164"
                   OpName %r_ptr_0 "r_ptr_0"
                   OpName %return_borrow "return borrow"
                   OpName %void "void"
                   OpName %fn_4 "fn_4"
                   OpName %field_add_private_private_private_arg_0 "field_add_private_private_private_arg_0"
                   OpName %field_add_private_private_private_arg_1 "field_add_private_private_private_arg_1"
                   OpName %field_add_private_private_private_arg_2 "field_add_private_private_private_arg_2"
                   OpName %field_add_private_private_private "field_add_private_private_private"
                   OpName %fn_start_7 "fn_start_7"
                   OpName %fn_return_3 "fn_return_3"
                   OpName %anonymous_219 "anonymous_219"
                   OpName %if_then_5 "if_then_5"
                   OpName %if_after_5 "if_after_5"
                   OpName %fn_return_4 "fn_return_4"
                   OpName %anonymous_220 "anonymous_220"
                   OpName %if_then_6 "if_then_6"
                   OpName %if_after_6 "if_after_6"
                   OpName %fn_return_5 "fn_return_5"
                   OpName %field_square_private_private_private_arg_0 "field_square_private_private_private_arg_0"
                   OpName %field_square_private_private_private_arg_1 "field_square_private_private_private_arg_1"
                   OpName %fn_6 "fn_6"
                   OpName %field_square_private_private_private "field_square_private_private_private"
                   OpName %fn_start_9 "fn_start_9"
                   OpName %field_mul_private_private_private_arg_0 "field_mul_private_private_private_arg_0"
                   OpName %field_mul_private_private_private_arg_1 "field_mul_private_private_private_arg_1"
                   OpName %field_mul_private_private_private_arg_2 "field_mul_private_private_private_arg_2"
                   OpName %field_mul_private_private_private "field_mul_private_private_private"
                   OpName %fn_start_10 "fn_start_10"
                   OpName %global_3 "global_3"
                   OpName %global_4 "global_4"
                   OpName %global_5 "global_5"
                   OpName %global_6 "global_6"
                   OpName %curve_double_arg_0 "curve_double_arg_0"
                   OpName %curve_double_arg_1 "curve_double_arg_1"
                   OpName %fn_8 "fn_8"
                   OpName %curve_double "curve_double"
                   OpName %fn_start_12 "fn_start_12"
                   OpName %this_x "this_x"
                   OpName %this_y "this_y"
                   OpName %this_z "this_z"
                   OpName %res_x "res_x"
                   OpName %res_y "res_y"
                   OpName %res_z "res_z"
                   OpName %fn_return_9 "fn_return_9"
                   OpName %fn_return_10 "fn_return_10"
                   OpName %fn_return_11 "fn_return_11"
                   OpName %fn_return_12 "fn_return_12"
                   OpName %fn_return_13 "fn_return_13"
                   OpName %fn_return_14 "fn_return_14"
                   OpName %fn_return_15 "fn_return_15"
                   OpName %fn_return_16 "fn_return_16"
                   OpName %fn_return_17 "fn_return_17"
                   OpName %fn_return_18 "fn_return_18"
                   OpName %fn_return_19 "fn_return_19"
                   OpName %fn_return_20 "fn_return_20"
                   OpName %fn_return_21 "fn_return_21"
                   OpName %main_var_0 "main_var_0"
                   OpName %fn_11 "fn_11"
                   OpName %fn_start_15 "fn_start_15"
                   OpName %storage_buffer_struct_ptr "storage_buffer_struct_ptr"
                   OpName %anonymous_232 "anonymous_232"
                   OpName %anonymous_233 "anonymous_233"
                   OpName %input_u32_ptr "input_u32_ptr"
                   OpName %anonymous_234 "anonymous_234"
                   OpName %id "id"
                   OpName %storage_buffer_struct_runtime_array_ptr "storage_buffer_struct_runtime_array_ptr"
                   OpName %anonymous_235 "anonymous_235"
                   OpName %storage_buffer_struct_ptr_0 "storage_buffer_struct_ptr_0"
                   OpName %anonymous_236 "anonymous_236"
                   OpName %anonymous_237 "anonymous_237"
                   OpName %anonymous_238 "anonymous_238"
                   OpName %fn_return_48 "fn_return_48"
                   OpDecorate %u32_array ArrayStride 4
                   OpMemberDecorate %struct 0 Offset 0
                   OpDecorate %global_invocation BuiltIn GlobalInvocationId
                   OpMemberDecorate %struct_0 0 Offset 0
                   OpMemberDecorate %struct_0 1 Offset 96
                   OpMemberDecorate %struct_0 2 Offset 192
                   OpDecorate %struct_runtime_array ArrayStride 288
                   OpDecorate %storage_buffer_struct_runtime_array BufferBlock
                   OpMemberDecorate %storage_buffer_struct_runtime_array 0 Offset 0
                   OpDecorate %descriptor_set_0_0 DescriptorSet 0
                   OpDecorate %descriptor_set_0_0 Binding 0
                   OpDecorate %descriptor_set_0_1 DescriptorSet 0
                   OpDecorate %descriptor_set_0_1 Binding 1
                   OpDecorate %storage_buffer_struct BufferBlock
                   OpMemberDecorate %storage_buffer_struct 0 Offset 0
                   OpDecorate %descriptor_set_0_2 DescriptorSet 0
                   OpDecorate %descriptor_set_0_2 Binding 2
                   OpDecorate %descriptor_set_0_3 DescriptorSet 0
                   OpDecorate %descriptor_set_0_3 Binding 3
                   OpMemberDecorate %struct_1 0 Offset 0
                   OpMemberDecorate %struct_1 1 Offset 4
            %u32 = OpTypeInt 32 0
              %1 = OpSpecConstant %u32 24
              %2 = OpSpecConstant %u32 2
              %3 = OpSpecConstantOp %u32 IMul %1 %2
       %c_u32_24 = OpConstant %u32 24
        %c_u32_1 = OpConstant %u32 1
        %c_u32_0 = OpConstant %u32 0
        %c_u32_2 = OpConstant %u32 2
      %u32_array = OpTypeArray %u32 %c_u32_24
         %struct = OpTypeStruct %u32_array
    %private_struct_ptr = OpTypePointer Private %struct
         %vector = OpTypeVector %u32 3
    %input_vector_ptr = OpTypePointer Input %vector
       %struct_0 = OpTypeStruct %struct %struct %struct
    %struct_runtime_array = OpTypeRuntimeArray %struct_0
    %storage_buffer_struct_runtime_array = OpTypeStruct %struct_runtime_array
    %storage_buffer_storage_buffer_struct_runtime_array_ptr = OpTypePointer StorageBuffer %storage_buffer_struct_runtime_array
    %storage_buffer_struct = OpTypeStruct %struct
    %storage_buffer_storage_buffer_struct_ptr = OpTypePointer StorageBuffer %storage_buffer_struct
    %private_struct_ptr_0 = OpTypePointer Private %struct_0
           %bool = OpTypeBool
    %function_u32_ptr = OpTypePointer Function %u32
    %private_u32_array_ptr = OpTypePointer Private %u32_array
    %private_u32_ptr = OpTypePointer Private %u32
       %struct_1 = OpTypeStruct %u32 %u32
           %fn_3 = OpTypeFunction %u32 %private_struct_ptr %private_struct_ptr %private_struct_ptr
           %void = OpTypeVoid
           %fn_4 = OpTypeFunction %void %private_struct_ptr %private_struct_ptr %private_struct_ptr
           %fn_6 = OpTypeFunction %void %private_struct_ptr %private_struct_ptr
           %fn_8 = OpTypeFunction %void %private_struct_ptr_0 %private_struct_ptr_0
          %fn_11 = OpTypeFunction %void
    %storage_buffer_struct_ptr = OpTypePointer StorageBuffer %struct
    %input_u32_ptr = OpTypePointer Input %u32
    %storage_buffer_struct_runtime_array_ptr = OpTypePointer StorageBuffer %struct_runtime_array
    %storage_buffer_struct_ptr_0 = OpTypePointer StorageBuffer %struct_0
       %global_6 = OpVariable %private_struct_ptr Private
       %global_5 = OpVariable %private_struct_ptr Private
       %global_4 = OpVariable %private_struct_ptr Private
       %global_3 = OpVariable %private_struct_ptr Private
       %global_2 = OpVariable %private_struct_ptr_0 Private
       %global_1 = OpVariable %private_struct_ptr_0 Private
    %descriptor_set_0_3 = OpVariable %storage_buffer_storage_buffer_struct_ptr StorageBuffer
    %descriptor_set_0_2 = OpVariable %storage_buffer_storage_buffer_struct_ptr StorageBuffer
    %descriptor_set_0_1 = OpVariable %storage_buffer_storage_buffer_struct_runtime_array_ptr StorageBuffer
    %descriptor_set_0_0 = OpVariable %storage_buffer_storage_buffer_struct_runtime_array_ptr StorageBuffer
    %global_invocation = OpVariable %input_vector_ptr Input
       %global_0 = OpVariable %private_struct_ptr Private
         %global = OpVariable %private_struct_ptr Private
    %field_square_private_private_private = OpFunction %void None %fn_6
    %field_square_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %field_square_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
     %fn_start_9 = OpLabel
                   OpReturn
                   OpFunctionEnd
    %field_add_private_private_private = OpFunction %void None %fn_4
    %field_add_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %field_add_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %field_add_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
     %fn_start_7 = OpLabel
    %fn_return_3 = OpFunctionCall %u32 %bignum_add_private_private_private %field_add_private_private_private_arg_0 %field_add_private_private_private_arg_1 %field_add_private_private_private_arg_2
    %anonymous_219 = OpIEqual %bool %fn_return_3 %c_u32_1
                   OpBranchConditional %anonymous_219 %if_then_5 %if_after_5
      %if_then_5 = OpLabel
    %fn_return_4 = OpFunctionCall %u32 %bignum_sub_private_private_private %field_add_private_private_private_arg_0 %field_add_private_private_private_arg_0 %global
    %anonymous_220 = OpIEqual %bool %fn_return_4 %c_u32_0
                   OpBranchConditional %anonymous_220 %if_then_6 %if_after_6
      %if_then_6 = OpLabel
    %fn_return_5 = OpFunctionCall %u32 %bignum_sub_private_private_private %field_add_private_private_private_arg_0 %field_add_private_private_private_arg_0 %global
                   OpBranch %if_after_6
     %if_after_6 = OpLabel
                   OpBranch %if_after_5
     %if_after_5 = OpLabel
                   OpReturn
                   OpFunctionEnd
    %bignum_sub_private_private_private = OpFunction %u32 None %fn_3
    %bignum_sub_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %bignum_sub_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %bignum_sub_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
     %fn_start_4 = OpLabel
    %bignum_sub_private_private_private_var_0 = OpVariable %function_u32_ptr Function
    %bignum_sub_private_private_private_var_1 = OpVariable %function_u32_ptr Function
                   OpStore %bignum_sub_private_private_private_var_1 %c_u32_0
    %anonymous_154 = OpAccessChain %private_u32_array_ptr %bignum_sub_private_private_private_arg_1 %c_u32_0
    %anonymous_155 = OpAccessChain %private_u32_array_ptr %bignum_sub_private_private_private_arg_2 %c_u32_0
    %anonymous_156 = OpAccessChain %private_u32_array_ptr %bignum_sub_private_private_private_arg_0 %c_u32_0
    %anonymous_157 = OpISub %u32 %1 %c_u32_1
                   OpStore %bignum_sub_private_private_private_var_0 %c_u32_0
                   OpBranch %loop_header_3
    %loop_header_3 = OpLabel
                   OpLoopMerge %loop_merge_3 %loop_continue_3 None
                   OpBranch %loop_merge_3
    %loop_merge_3 = OpLabel
          %var_8 = OpLoad %u32 %bignum_sub_private_private_private_var_0
         %cond_3 = OpULessThanEqual %bool %var_8 %anonymous_157
                   OpBranchConditional %cond_3 %loop_body_3 %loop_after_3
    %loop_body_3 = OpLabel
        %x_ptr_0 = OpAccessChain %private_u32_ptr %anonymous_154 %var_8
            %x_0 = OpLoad %u32 %x_ptr_0
        %y_ptr_0 = OpAccessChain %private_u32_ptr %anonymous_155 %var_8
            %y_0 = OpLoad %u32 %y_ptr_0
    %anonymous_158 = OpISubBorrow %struct_1 %x_0 %y_0
    %anonymous_159 = OpCompositeExtract %u32 %anonymous_158 0
    %anonymous_160 = OpCompositeExtract %u32 %anonymous_158 1
         %borrow = OpLoad %u32 %bignum_sub_private_private_private_var_1
    %anonymous_161 = OpISubBorrow %struct_1 %anonymous_159 %borrow
    %anonymous_162 = OpCompositeExtract %u32 %anonymous_161 0
    %anonymous_163 = OpCompositeExtract %u32 %anonymous_161 1
    %anonymous_164 = OpIAdd %u32 %anonymous_160 %anonymous_163
                   OpStore %bignum_sub_private_private_private_var_1 %anonymous_164
        %r_ptr_0 = OpAccessChain %private_u32_ptr %anonymous_156 %var_8
                   OpStore %r_ptr_0 %anonymous_162
                   OpBranch %loop_continue_3
    %loop_continue_3 = OpLabel
          %var_9 = OpIAdd %u32 %var_8 %c_u32_1
                   OpStore %bignum_sub_private_private_private_var_0 %var_9
                   OpBranch %loop_header_3
    %loop_after_3 = OpLabel
    %return_borrow = OpLoad %u32 %bignum_sub_private_private_private_var_1
                   OpReturnValue %return_borrow
                   OpFunctionEnd
    %bignum_add_private_private_private = OpFunction %u32 None %fn_3
    %bignum_add_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %bignum_add_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %bignum_add_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
     %fn_start_3 = OpLabel
    %bignum_add_private_private_private_var_0 = OpVariable %function_u32_ptr Function
    %bignum_add_private_private_private_var_1 = OpVariable %function_u32_ptr Function
                   OpStore %bignum_add_private_private_private_var_1 %c_u32_0
    %anonymous_143 = OpAccessChain %private_u32_array_ptr %bignum_add_private_private_private_arg_1 %c_u32_0
    %anonymous_144 = OpAccessChain %private_u32_array_ptr %bignum_add_private_private_private_arg_2 %c_u32_0
    %anonymous_145 = OpAccessChain %private_u32_array_ptr %bignum_add_private_private_private_arg_0 %c_u32_0
    %anonymous_146 = OpISub %u32 %1 %c_u32_1
                   OpStore %bignum_add_private_private_private_var_0 %c_u32_0
                   OpBranch %loop_header_2
    %loop_header_2 = OpLabel
                   OpLoopMerge %loop_merge_2 %loop_continue_2 None
                   OpBranch %loop_merge_2
    %loop_merge_2 = OpLabel
          %var_6 = OpLoad %u32 %bignum_add_private_private_private_var_0
         %cond_2 = OpULessThanEqual %bool %var_6 %anonymous_146
                   OpBranchConditional %cond_2 %loop_body_2 %loop_after_2
    %loop_body_2 = OpLabel
          %x_ptr = OpAccessChain %private_u32_ptr %anonymous_143 %var_6
              %x = OpLoad %u32 %x_ptr
          %y_ptr = OpAccessChain %private_u32_ptr %anonymous_144 %var_6
              %y = OpLoad %u32 %y_ptr
    %anonymous_147 = OpIAddCarry %struct_1 %x %y
    %anonymous_148 = OpCompositeExtract %u32 %anonymous_147 0
    %anonymous_149 = OpCompositeExtract %u32 %anonymous_147 1
          %carry = OpLoad %u32 %bignum_add_private_private_private_var_1
    %anonymous_150 = OpIAddCarry %struct_1 %anonymous_148 %carry
    %anonymous_151 = OpCompositeExtract %u32 %anonymous_150 0
    %anonymous_152 = OpCompositeExtract %u32 %anonymous_150 1
    %anonymous_153 = OpIAdd %u32 %anonymous_149 %anonymous_152
                   OpStore %bignum_add_private_private_private_var_1 %anonymous_153
          %r_ptr = OpAccessChain %private_u32_ptr %anonymous_145 %var_6
                   OpStore %r_ptr %anonymous_151
                   OpBranch %loop_continue_2
    %loop_continue_2 = OpLabel
          %var_7 = OpIAdd %u32 %var_6 %c_u32_1
                   OpStore %bignum_add_private_private_private_var_0 %var_7
                   OpBranch %loop_header_2
    %loop_after_2 = OpLabel
    %return_carry = OpLoad %u32 %bignum_add_private_private_private_var_1
                   OpReturnValue %return_carry
                   OpFunctionEnd
    %curve_double = OpFunction %void None %fn_8
    %curve_double_arg_0 = OpFunctionParameter %private_struct_ptr_0
    %curve_double_arg_1 = OpFunctionParameter %private_struct_ptr_0
    %fn_start_12 = OpLabel
         %this_x = OpAccessChain %private_struct_ptr %curve_double_arg_1 %c_u32_0
         %this_y = OpAccessChain %private_struct_ptr %curve_double_arg_1 %c_u32_1
         %this_z = OpAccessChain %private_struct_ptr %curve_double_arg_1 %c_u32_2
          %res_x = OpAccessChain %private_struct_ptr %curve_double_arg_0 %c_u32_0
          %res_y = OpAccessChain %private_struct_ptr %curve_double_arg_0 %c_u32_1
          %res_z = OpAccessChain %private_struct_ptr %curve_double_arg_0 %c_u32_2
    %fn_return_9 = OpFunctionCall %void %field_square_private_private_private %res_x %this_x
    %fn_return_10 = OpFunctionCall %void %field_square_private_private_private %res_z %this_z
    %fn_return_11 = OpFunctionCall %void %field_add_private_private_private %global_3 %res_x %res_x
    %fn_return_12 = OpFunctionCall %void %field_mul_private_private_private %res_z %global_0 %res_z
    %fn_return_13 = OpFunctionCall %void %field_add_private_private_private %res_x %global_3 %res_x
    %fn_return_14 = OpFunctionCall %void %field_add_private_private_private %global_3 %res_z %res_x
    %fn_return_15 = OpFunctionCall %void %field_mul_private_private_private %global_4 %this_z %this_y
    %fn_return_16 = OpFunctionCall %void %field_add_private_private_private %global_4 %global_4 %global_4
    %fn_return_17 = OpFunctionCall %void %field_square_private_private_private %res_z %global_4
    %fn_return_18 = OpFunctionCall %void %field_mul_private_private_private %res_z %res_z %global_4
    %fn_return_19 = OpFunctionCall %void %field_mul_private_private_private %global_5 %this_y %global_4
    %fn_return_20 = OpFunctionCall %void %field_square_private_private_private %global_6 %global_5
    %fn_return_21 = OpFunctionCall %void %field_add_private_private_private %global_5 %this_x %global_5
                   OpReturn
                   OpFunctionEnd
    %field_mul_private_private_private = OpFunction %void None %fn_4
    %field_mul_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %field_mul_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %field_mul_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
    %fn_start_10 = OpLabel
                   OpReturn
                   OpFunctionEnd
            %639 = OpFunction %void None %fn_11
    %fn_start_15 = OpLabel
     %main_var_0 = OpVariable %function_u32_ptr Function
    %anonymous_232 = OpAccessChain %storage_buffer_struct_ptr %descriptor_set_0_2 %c_u32_0
                   OpCopyMemory %global %anonymous_232
    %anonymous_233 = OpAccessChain %storage_buffer_struct_ptr %descriptor_set_0_3 %c_u32_0
                   OpCopyMemory %global_0 %anonymous_233
    %anonymous_234 = OpAccessChain %input_u32_ptr %global_invocation %c_u32_0
             %id = OpLoad %u32 %anonymous_234
    %anonymous_235 = OpAccessChain %storage_buffer_struct_runtime_array_ptr %descriptor_set_0_0 %c_u32_0
    %anonymous_236 = OpAccessChain %storage_buffer_struct_ptr_0 %anonymous_235 %id
    %anonymous_237 = OpAccessChain %storage_buffer_struct_runtime_array_ptr %descriptor_set_0_1 %c_u32_0
    %anonymous_238 = OpAccessChain %storage_buffer_struct_ptr_0 %anonymous_237 %id
                   OpCopyMemory %global_1 %anonymous_236
    %fn_return_48 = OpFunctionCall %void %curve_double %global_2 %global_1
                   OpCopyMemory %anonymous_238 %global_2
                   OpReturn
                   OpFunctionEnd

    BROKEN SHADER
    Code :
    ; SPIR-V
    ; Version: 1.3
    ; Generator: Khronos; 64222
    ; Bound: 655
    ; Schema: 0
                   OpCapability Shader
                   OpExtension "SPV_KHR_storage_buffer_storage_class"
                   OpMemoryModel Logical Simple
                   OpEntryPoint GLCompute %640 "main" %global_invocation
                   OpExecutionMode %640 LocalSize 1 1 1
                   OpName %u32 "u32"
                   OpName %c_u32_24 "c_u32_24"
                   OpName %u32_array "u32_array"
                   OpName %struct "struct"
                   OpName %private_struct_ptr "private_struct_ptr"
                   OpName %global "global"
                   OpName %global_0 "global_0"
                   OpName %vector "vector"
                   OpName %input_vector_ptr "input_vector_ptr"
                   OpName %global_invocation "global_invocation"
                   OpName %struct_0 "struct_0"
                   OpName %struct_runtime_array "struct_runtime_array"
                   OpName %storage_buffer_struct_runtime_array "storage_buffer_struct_runtime_array"
                   OpName %storage_buffer_storage_buffer_struct_runtime_array_ptr "storage_buffer_storage_buffer_struct_runtime_array_ptr"
                   OpName %descriptor_set_0_0 "descriptor_set_0_0"
                   OpName %descriptor_set_0_1 "descriptor_set_0_1"
                   OpName %storage_buffer_struct "storage_buffer_struct"
                   OpName %storage_buffer_storage_buffer_struct_ptr "storage_buffer_storage_buffer_struct_ptr"
                   OpName %descriptor_set_0_2 "descriptor_set_0_2"
                   OpName %descriptor_set_0_3 "descriptor_set_0_3"
                   OpName %private_struct_ptr_0 "private_struct_ptr_0"
                   OpName %global_1 "global_1"
                   OpName %global_2 "global_2"
                   OpName %c_u32_0 "c_u32_0"
                   OpName %c_u32_1 "c_u32_1"
                   OpName %bool "bool"
                   OpName %function_u32_ptr "function_u32_ptr"
                   OpName %private_u32_array_ptr "private_u32_array_ptr"
                   OpName %private_u32_ptr "private_u32_ptr"
                   OpName %struct_1 "struct_1"
                   OpName %c_u32_2 "c_u32_2"
                   OpName %bignum_add_private_private_private_arg_0 "bignum_add_private_private_private_arg_0"
                   OpName %bignum_add_private_private_private_arg_1 "bignum_add_private_private_private_arg_1"
                   OpName %bignum_add_private_private_private_arg_2 "bignum_add_private_private_private_arg_2"
                   OpName %bignum_add_private_private_private_var_0 "bignum_add_private_private_private_var_0"
                   OpName %bignum_add_private_private_private_var_1 "bignum_add_private_private_private_var_1"
                   OpName %fn_3 "fn_3"
                   OpName %bignum_add_private_private_private "bignum_add_private_private_private"
                   OpName %fn_start_3 "fn_start_3"
                   OpName %anonymous_143 "anonymous_143"
                   OpName %anonymous_144 "anonymous_144"
                   OpName %anonymous_145 "anonymous_145"
                   OpName %anonymous_146 "anonymous_146"
                   OpName %loop_header_2 "loop_header_2"
                   OpName %loop_merge_2 "loop_merge_2"
                   OpName %loop_body_2 "loop_body_2"
                   OpName %loop_continue_2 "loop_continue_2"
                   OpName %loop_after_2 "loop_after_2"
                   OpName %var_6 "var_6"
                   OpName %var_7 "var_7"
                   OpName %cond_2 "cond_2"
                   OpName %x_ptr "x_ptr"
                   OpName %x "x"
                   OpName %y_ptr "y_ptr"
                   OpName %y "y"
                   OpName %anonymous_147 "anonymous_147"
                   OpName %anonymous_148 "anonymous_148"
                   OpName %anonymous_149 "anonymous_149"
                   OpName %carry "carry"
                   OpName %anonymous_150 "anonymous_150"
                   OpName %anonymous_151 "anonymous_151"
                   OpName %anonymous_152 "anonymous_152"
                   OpName %anonymous_153 "anonymous_153"
                   OpName %r_ptr "r_ptr"
                   OpName %return_carry "return_carry"
                   OpName %bignum_sub_private_private_private_arg_0 "bignum_sub_private_private_private_arg_0"
                   OpName %bignum_sub_private_private_private_arg_1 "bignum_sub_private_private_private_arg_1"
                   OpName %bignum_sub_private_private_private_arg_2 "bignum_sub_private_private_private_arg_2"
                   OpName %bignum_sub_private_private_private_var_0 "bignum_sub_private_private_private_var_0"
                   OpName %bignum_sub_private_private_private_var_1 "bignum_sub_private_private_private_var_1"
                   OpName %bignum_sub_private_private_private "bignum_sub_private_private_private"
                   OpName %fn_start_4 "fn_start_4"
                   OpName %anonymous_154 "anonymous_154"
                   OpName %anonymous_155 "anonymous_155"
                   OpName %anonymous_156 "anonymous_156"
                   OpName %anonymous_157 "anonymous_157"
                   OpName %loop_header_3 "loop_header_3"
                   OpName %loop_merge_3 "loop_merge_3"
                   OpName %loop_body_3 "loop_body_3"
                   OpName %loop_continue_3 "loop_continue_3"
                   OpName %loop_after_3 "loop_after_3"
                   OpName %var_8 "var_8"
                   OpName %var_9 "var_9"
                   OpName %cond_3 "cond_3"
                   OpName %x_ptr_0 "x_ptr_0"
                   OpName %x_0 "x_0"
                   OpName %y_ptr_0 "y_ptr_0"
                   OpName %y_0 "y_0"
                   OpName %anonymous_158 "anonymous_158"
                   OpName %anonymous_159 "anonymous_159"
                   OpName %anonymous_160 "anonymous_160"
                   OpName %borrow "borrow"
                   OpName %anonymous_161 "anonymous_161"
                   OpName %anonymous_162 "anonymous_162"
                   OpName %anonymous_163 "anonymous_163"
                   OpName %anonymous_164 "anonymous_164"
                   OpName %r_ptr_0 "r_ptr_0"
                   OpName %return_borrow "return borrow"
                   OpName %void "void"
                   OpName %fn_4 "fn_4"
                   OpName %field_add_private_private_private_arg_0 "field_add_private_private_private_arg_0"
                   OpName %field_add_private_private_private_arg_1 "field_add_private_private_private_arg_1"
                   OpName %field_add_private_private_private_arg_2 "field_add_private_private_private_arg_2"
                   OpName %field_add_private_private_private "field_add_private_private_private"
                   OpName %fn_start_7 "fn_start_7"
                   OpName %fn_return_3 "fn_return_3"
                   OpName %anonymous_219 "anonymous_219"
                   OpName %if_then_5 "if_then_5"
                   OpName %if_after_5 "if_after_5"
                   OpName %fn_return_4 "fn_return_4"
                   OpName %anonymous_220 "anonymous_220"
                   OpName %if_then_6 "if_then_6"
                   OpName %if_after_6 "if_after_6"
                   OpName %fn_return_5 "fn_return_5"
                   OpName %field_square_private_private_private_arg_0 "field_square_private_private_private_arg_0"
                   OpName %field_square_private_private_private_arg_1 "field_square_private_private_private_arg_1"
                   OpName %fn_6 "fn_6"
                   OpName %field_square_private_private_private "field_square_private_private_private"
                   OpName %fn_start_9 "fn_start_9"
                   OpName %field_mul_private_private_private_arg_0 "field_mul_private_private_private_arg_0"
                   OpName %field_mul_private_private_private_arg_1 "field_mul_private_private_private_arg_1"
                   OpName %field_mul_private_private_private_arg_2 "field_mul_private_private_private_arg_2"
                   OpName %field_mul_private_private_private "field_mul_private_private_private"
                   OpName %fn_start_10 "fn_start_10"
                   OpName %global_3 "global_3"
                   OpName %global_4 "global_4"
                   OpName %global_5 "global_5"
                   OpName %global_6 "global_6"
                   OpName %curve_double_arg_0 "curve_double_arg_0"
                   OpName %curve_double_arg_1 "curve_double_arg_1"
                   OpName %fn_8 "fn_8"
                   OpName %curve_double "curve_double"
                   OpName %fn_start_12 "fn_start_12"
                   OpName %this_x "this_x"
                   OpName %this_y "this_y"
                   OpName %this_z "this_z"
                   OpName %res_x "res_x"
                   OpName %res_y "res_y"
                   OpName %res_z "res_z"
                   OpName %fn_return_9 "fn_return_9"
                   OpName %fn_return_10 "fn_return_10"
                   OpName %fn_return_11 "fn_return_11"
                   OpName %fn_return_12 "fn_return_12"
                   OpName %fn_return_13 "fn_return_13"
                   OpName %fn_return_14 "fn_return_14"
                   OpName %fn_return_15 "fn_return_15"
                   OpName %fn_return_16 "fn_return_16"
                   OpName %fn_return_17 "fn_return_17"
                   OpName %fn_return_18 "fn_return_18"
                   OpName %fn_return_19 "fn_return_19"
                   OpName %fn_return_20 "fn_return_20"
                   OpName %fn_return_21 "fn_return_21"
                   OpName %fn_return_22 "fn_return_22"
                   OpName %main_var_0 "main_var_0"
                   OpName %fn_11 "fn_11"
                   OpName %fn_start_15 "fn_start_15"
                   OpName %storage_buffer_struct_ptr "storage_buffer_struct_ptr"
                   OpName %anonymous_232 "anonymous_232"
                   OpName %anonymous_233 "anonymous_233"
                   OpName %input_u32_ptr "input_u32_ptr"
                   OpName %anonymous_234 "anonymous_234"
                   OpName %id "id"
                   OpName %storage_buffer_struct_runtime_array_ptr "storage_buffer_struct_runtime_array_ptr"
                   OpName %anonymous_235 "anonymous_235"
                   OpName %storage_buffer_struct_ptr_0 "storage_buffer_struct_ptr_0"
                   OpName %anonymous_236 "anonymous_236"
                   OpName %anonymous_237 "anonymous_237"
                   OpName %anonymous_238 "anonymous_238"
                   OpName %fn_return_49 "fn_return_49"
                   OpDecorate %u32_array ArrayStride 4
                   OpMemberDecorate %struct 0 Offset 0
                   OpDecorate %global_invocation BuiltIn GlobalInvocationId
                   OpMemberDecorate %struct_0 0 Offset 0
                   OpMemberDecorate %struct_0 1 Offset 96
                   OpMemberDecorate %struct_0 2 Offset 192
                   OpDecorate %struct_runtime_array ArrayStride 288
                   OpDecorate %storage_buffer_struct_runtime_array BufferBlock
                   OpMemberDecorate %storage_buffer_struct_runtime_array 0 Offset 0
                   OpDecorate %descriptor_set_0_0 DescriptorSet 0
                   OpDecorate %descriptor_set_0_0 Binding 0
                   OpDecorate %descriptor_set_0_1 DescriptorSet 0
                   OpDecorate %descriptor_set_0_1 Binding 1
                   OpDecorate %storage_buffer_struct BufferBlock
                   OpMemberDecorate %storage_buffer_struct 0 Offset 0
                   OpDecorate %descriptor_set_0_2 DescriptorSet 0
                   OpDecorate %descriptor_set_0_2 Binding 2
                   OpDecorate %descriptor_set_0_3 DescriptorSet 0
                   OpDecorate %descriptor_set_0_3 Binding 3
                   OpMemberDecorate %struct_1 0 Offset 0
                   OpMemberDecorate %struct_1 1 Offset 4
            %u32 = OpTypeInt 32 0
              %1 = OpSpecConstant %u32 24
              %2 = OpSpecConstant %u32 2
              %3 = OpSpecConstantOp %u32 IMul %1 %2
       %c_u32_24 = OpConstant %u32 24
        %c_u32_1 = OpConstant %u32 1
        %c_u32_0 = OpConstant %u32 0
        %c_u32_2 = OpConstant %u32 2
      %u32_array = OpTypeArray %u32 %c_u32_24
         %struct = OpTypeStruct %u32_array
    %private_struct_ptr = OpTypePointer Private %struct
         %vector = OpTypeVector %u32 3
    %input_vector_ptr = OpTypePointer Input %vector
       %struct_0 = OpTypeStruct %struct %struct %struct
    %struct_runtime_array = OpTypeRuntimeArray %struct_0
    %storage_buffer_struct_runtime_array = OpTypeStruct %struct_runtime_array
    %storage_buffer_storage_buffer_struct_runtime_array_ptr = OpTypePointer StorageBuffer %storage_buffer_struct_runtime_array
    %storage_buffer_struct = OpTypeStruct %struct
    %storage_buffer_storage_buffer_struct_ptr = OpTypePointer StorageBuffer %storage_buffer_struct
    %private_struct_ptr_0 = OpTypePointer Private %struct_0
           %bool = OpTypeBool
    %function_u32_ptr = OpTypePointer Function %u32
    %private_u32_array_ptr = OpTypePointer Private %u32_array
    %private_u32_ptr = OpTypePointer Private %u32
       %struct_1 = OpTypeStruct %u32 %u32
           %fn_3 = OpTypeFunction %u32 %private_struct_ptr %private_struct_ptr %private_struct_ptr
           %void = OpTypeVoid
           %fn_4 = OpTypeFunction %void %private_struct_ptr %private_struct_ptr %private_struct_ptr
           %fn_6 = OpTypeFunction %void %private_struct_ptr %private_struct_ptr
           %fn_8 = OpTypeFunction %void %private_struct_ptr_0 %private_struct_ptr_0
          %fn_11 = OpTypeFunction %void
    %storage_buffer_struct_ptr = OpTypePointer StorageBuffer %struct
    %input_u32_ptr = OpTypePointer Input %u32
    %storage_buffer_struct_runtime_array_ptr = OpTypePointer StorageBuffer %struct_runtime_array
    %storage_buffer_struct_ptr_0 = OpTypePointer StorageBuffer %struct_0
       %global_6 = OpVariable %private_struct_ptr Private
       %global_5 = OpVariable %private_struct_ptr Private
       %global_4 = OpVariable %private_struct_ptr Private
       %global_3 = OpVariable %private_struct_ptr Private
       %global_2 = OpVariable %private_struct_ptr_0 Private
       %global_1 = OpVariable %private_struct_ptr_0 Private
    %descriptor_set_0_3 = OpVariable %storage_buffer_storage_buffer_struct_ptr StorageBuffer
    %descriptor_set_0_2 = OpVariable %storage_buffer_storage_buffer_struct_ptr StorageBuffer
    %descriptor_set_0_1 = OpVariable %storage_buffer_storage_buffer_struct_runtime_array_ptr StorageBuffer
    %descriptor_set_0_0 = OpVariable %storage_buffer_storage_buffer_struct_runtime_array_ptr StorageBuffer
    %global_invocation = OpVariable %input_vector_ptr Input
       %global_0 = OpVariable %private_struct_ptr Private
         %global = OpVariable %private_struct_ptr Private
    %field_square_private_private_private = OpFunction %void None %fn_6
    %field_square_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %field_square_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
     %fn_start_9 = OpLabel
                   OpReturn
                   OpFunctionEnd
    %field_add_private_private_private = OpFunction %void None %fn_4
    %field_add_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %field_add_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %field_add_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
     %fn_start_7 = OpLabel
    %fn_return_3 = OpFunctionCall %u32 %bignum_add_private_private_private %field_add_private_private_private_arg_0 %field_add_private_private_private_arg_1 %field_add_private_private_private_arg_2
    %anonymous_219 = OpIEqual %bool %fn_return_3 %c_u32_1
                   OpBranchConditional %anonymous_219 %if_then_5 %if_after_5
      %if_then_5 = OpLabel
    %fn_return_4 = OpFunctionCall %u32 %bignum_sub_private_private_private %field_add_private_private_private_arg_0 %field_add_private_private_private_arg_0 %global
    %anonymous_220 = OpIEqual %bool %fn_return_4 %c_u32_0
                   OpBranchConditional %anonymous_220 %if_then_6 %if_after_6
      %if_then_6 = OpLabel
    %fn_return_5 = OpFunctionCall %u32 %bignum_sub_private_private_private %field_add_private_private_private_arg_0 %field_add_private_private_private_arg_0 %global
                   OpBranch %if_after_6
     %if_after_6 = OpLabel
                   OpBranch %if_after_5
     %if_after_5 = OpLabel
                   OpReturn
                   OpFunctionEnd
    %bignum_sub_private_private_private = OpFunction %u32 None %fn_3
    %bignum_sub_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %bignum_sub_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %bignum_sub_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
     %fn_start_4 = OpLabel
    %bignum_sub_private_private_private_var_0 = OpVariable %function_u32_ptr Function
    %bignum_sub_private_private_private_var_1 = OpVariable %function_u32_ptr Function
                   OpStore %bignum_sub_private_private_private_var_1 %c_u32_0
    %anonymous_154 = OpAccessChain %private_u32_array_ptr %bignum_sub_private_private_private_arg_1 %c_u32_0
    %anonymous_155 = OpAccessChain %private_u32_array_ptr %bignum_sub_private_private_private_arg_2 %c_u32_0
    %anonymous_156 = OpAccessChain %private_u32_array_ptr %bignum_sub_private_private_private_arg_0 %c_u32_0
    %anonymous_157 = OpISub %u32 %1 %c_u32_1
                   OpStore %bignum_sub_private_private_private_var_0 %c_u32_0
                   OpBranch %loop_header_3
    %loop_header_3 = OpLabel
                   OpLoopMerge %loop_merge_3 %loop_continue_3 None
                   OpBranch %loop_merge_3
    %loop_merge_3 = OpLabel
          %var_8 = OpLoad %u32 %bignum_sub_private_private_private_var_0
         %cond_3 = OpULessThanEqual %bool %var_8 %anonymous_157
                   OpBranchConditional %cond_3 %loop_body_3 %loop_after_3
    %loop_body_3 = OpLabel
        %x_ptr_0 = OpAccessChain %private_u32_ptr %anonymous_154 %var_8
            %x_0 = OpLoad %u32 %x_ptr_0
        %y_ptr_0 = OpAccessChain %private_u32_ptr %anonymous_155 %var_8
            %y_0 = OpLoad %u32 %y_ptr_0
    %anonymous_158 = OpISubBorrow %struct_1 %x_0 %y_0
    %anonymous_159 = OpCompositeExtract %u32 %anonymous_158 0
    %anonymous_160 = OpCompositeExtract %u32 %anonymous_158 1
         %borrow = OpLoad %u32 %bignum_sub_private_private_private_var_1
    %anonymous_161 = OpISubBorrow %struct_1 %anonymous_159 %borrow
    %anonymous_162 = OpCompositeExtract %u32 %anonymous_161 0
    %anonymous_163 = OpCompositeExtract %u32 %anonymous_161 1
    %anonymous_164 = OpIAdd %u32 %anonymous_160 %anonymous_163
                   OpStore %bignum_sub_private_private_private_var_1 %anonymous_164
        %r_ptr_0 = OpAccessChain %private_u32_ptr %anonymous_156 %var_8
                   OpStore %r_ptr_0 %anonymous_162
                   OpBranch %loop_continue_3
    %loop_continue_3 = OpLabel
          %var_9 = OpIAdd %u32 %var_8 %c_u32_1
                   OpStore %bignum_sub_private_private_private_var_0 %var_9
                   OpBranch %loop_header_3
    %loop_after_3 = OpLabel
    %return_borrow = OpLoad %u32 %bignum_sub_private_private_private_var_1
                   OpReturnValue %return_borrow
                   OpFunctionEnd
    %bignum_add_private_private_private = OpFunction %u32 None %fn_3
    %bignum_add_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %bignum_add_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %bignum_add_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
     %fn_start_3 = OpLabel
    %bignum_add_private_private_private_var_0 = OpVariable %function_u32_ptr Function
    %bignum_add_private_private_private_var_1 = OpVariable %function_u32_ptr Function
                   OpStore %bignum_add_private_private_private_var_1 %c_u32_0
    %anonymous_143 = OpAccessChain %private_u32_array_ptr %bignum_add_private_private_private_arg_1 %c_u32_0
    %anonymous_144 = OpAccessChain %private_u32_array_ptr %bignum_add_private_private_private_arg_2 %c_u32_0
    %anonymous_145 = OpAccessChain %private_u32_array_ptr %bignum_add_private_private_private_arg_0 %c_u32_0
    %anonymous_146 = OpISub %u32 %1 %c_u32_1
                   OpStore %bignum_add_private_private_private_var_0 %c_u32_0
                   OpBranch %loop_header_2
    %loop_header_2 = OpLabel
                   OpLoopMerge %loop_merge_2 %loop_continue_2 None
                   OpBranch %loop_merge_2
    %loop_merge_2 = OpLabel
          %var_6 = OpLoad %u32 %bignum_add_private_private_private_var_0
         %cond_2 = OpULessThanEqual %bool %var_6 %anonymous_146
                   OpBranchConditional %cond_2 %loop_body_2 %loop_after_2
    %loop_body_2 = OpLabel
          %x_ptr = OpAccessChain %private_u32_ptr %anonymous_143 %var_6
              %x = OpLoad %u32 %x_ptr
          %y_ptr = OpAccessChain %private_u32_ptr %anonymous_144 %var_6
              %y = OpLoad %u32 %y_ptr
    %anonymous_147 = OpIAddCarry %struct_1 %x %y
    %anonymous_148 = OpCompositeExtract %u32 %anonymous_147 0
    %anonymous_149 = OpCompositeExtract %u32 %anonymous_147 1
          %carry = OpLoad %u32 %bignum_add_private_private_private_var_1
    %anonymous_150 = OpIAddCarry %struct_1 %anonymous_148 %carry
    %anonymous_151 = OpCompositeExtract %u32 %anonymous_150 0
    %anonymous_152 = OpCompositeExtract %u32 %anonymous_150 1
    %anonymous_153 = OpIAdd %u32 %anonymous_149 %anonymous_152
                   OpStore %bignum_add_private_private_private_var_1 %anonymous_153
          %r_ptr = OpAccessChain %private_u32_ptr %anonymous_145 %var_6
                   OpStore %r_ptr %anonymous_151
                   OpBranch %loop_continue_2
    %loop_continue_2 = OpLabel
          %var_7 = OpIAdd %u32 %var_6 %c_u32_1
                   OpStore %bignum_add_private_private_private_var_0 %var_7
                   OpBranch %loop_header_2
    %loop_after_2 = OpLabel
    %return_carry = OpLoad %u32 %bignum_add_private_private_private_var_1
                   OpReturnValue %return_carry
                   OpFunctionEnd
    %curve_double = OpFunction %void None %fn_8
    %curve_double_arg_0 = OpFunctionParameter %private_struct_ptr_0
    %curve_double_arg_1 = OpFunctionParameter %private_struct_ptr_0
    %fn_start_12 = OpLabel
         %this_x = OpAccessChain %private_struct_ptr %curve_double_arg_1 %c_u32_0
         %this_y = OpAccessChain %private_struct_ptr %curve_double_arg_1 %c_u32_1
         %this_z = OpAccessChain %private_struct_ptr %curve_double_arg_1 %c_u32_2
          %res_x = OpAccessChain %private_struct_ptr %curve_double_arg_0 %c_u32_0
          %res_y = OpAccessChain %private_struct_ptr %curve_double_arg_0 %c_u32_1
          %res_z = OpAccessChain %private_struct_ptr %curve_double_arg_0 %c_u32_2
    %fn_return_9 = OpFunctionCall %void %field_square_private_private_private %res_x %this_x
    %fn_return_10 = OpFunctionCall %void %field_square_private_private_private %res_z %this_z
    %fn_return_11 = OpFunctionCall %void %field_add_private_private_private %global_3 %res_x %res_x
    %fn_return_12 = OpFunctionCall %void %field_mul_private_private_private %res_z %global_0 %res_z
    %fn_return_13 = OpFunctionCall %void %field_add_private_private_private %res_x %global_3 %res_x
    %fn_return_14 = OpFunctionCall %void %field_add_private_private_private %global_3 %res_z %res_x
    %fn_return_15 = OpFunctionCall %void %field_mul_private_private_private %global_4 %this_z %this_y
    %fn_return_16 = OpFunctionCall %void %field_add_private_private_private %global_4 %global_4 %global_4
    %fn_return_17 = OpFunctionCall %void %field_square_private_private_private %res_z %global_4
    %fn_return_18 = OpFunctionCall %void %field_mul_private_private_private %res_z %res_z %global_4
    %fn_return_19 = OpFunctionCall %void %field_mul_private_private_private %global_5 %this_y %global_4
    %fn_return_20 = OpFunctionCall %void %field_square_private_private_private %global_6 %global_5
    %fn_return_21 = OpFunctionCall %void %field_add_private_private_private %global_5 %this_x %global_5
    %fn_return_22 = OpFunctionCall %void %field_square_private_private_private %global_5 %global_5
                   OpReturn
                   OpFunctionEnd
    %field_mul_private_private_private = OpFunction %void None %fn_4
    %field_mul_private_private_private_arg_0 = OpFunctionParameter %private_struct_ptr
    %field_mul_private_private_private_arg_1 = OpFunctionParameter %private_struct_ptr
    %field_mul_private_private_private_arg_2 = OpFunctionParameter %private_struct_ptr
    %fn_start_10 = OpLabel
                   OpReturn
                   OpFunctionEnd
            %640 = OpFunction %void None %fn_11
    %fn_start_15 = OpLabel
     %main_var_0 = OpVariable %function_u32_ptr Function
    %anonymous_232 = OpAccessChain %storage_buffer_struct_ptr %descriptor_set_0_2 %c_u32_0
                   OpCopyMemory %global %anonymous_232
    %anonymous_233 = OpAccessChain %storage_buffer_struct_ptr %descriptor_set_0_3 %c_u32_0
                   OpCopyMemory %global_0 %anonymous_233
    %anonymous_234 = OpAccessChain %input_u32_ptr %global_invocation %c_u32_0
             %id = OpLoad %u32 %anonymous_234
    %anonymous_235 = OpAccessChain %storage_buffer_struct_runtime_array_ptr %descriptor_set_0_0 %c_u32_0
    %anonymous_236 = OpAccessChain %storage_buffer_struct_ptr_0 %anonymous_235 %id
    %anonymous_237 = OpAccessChain %storage_buffer_struct_runtime_array_ptr %descriptor_set_0_1 %c_u32_0
    %anonymous_238 = OpAccessChain %storage_buffer_struct_ptr_0 %anonymous_237 %id
                   OpCopyMemory %global_1 %anonymous_236
    %fn_return_49 = OpFunctionCall %void %curve_double %global_2 %global_1
                   OpCopyMemory %anonymous_238 %global_2
                   OpReturn
                   OpFunctionEnd
    Last edited by nholland94; 08-06-2018 at 04:23 PM. Reason: add additional information

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean