The patch adds PrepareFunctions pass, which modifies function signatures containing aggregate arguments and/or return value before IR translation. Information about the original signatures is stored in metadata. It is used during call lowering to restore correct SPIRV types of function arguments and return values. This pass also substitutes some llvm intrinsic calls to function calls, generating required functions in the module as the SPIRV translator does.
Also the patch includes the changes in other modules, enabling many SPIRV features that were not very functional without DT patch by Aleksandr and were omitted earlier. As a result, many new LIT tests began to pass, 15 of them are also included into the patch, others will be added later.