julia
ed2cb490 - inference-directed codegen via CodeInstance edges and typeinf_ext_toplevel APIs (#56880)

Commit
1 year ago
inference-directed codegen via CodeInstance edges and typeinf_ext_toplevel APIs (#56880) This is building upon the many efforts around using CodeInstance everywhere (especially as the return value from jl_type_infer and the input format to edges) by moving a lot of hard-coded algorithms that were previously in C (such as `recursive_compile_graph` and `jl_ci_cache_lookup`), and which were therefore previously also slightly broken (especially with concurrent environments), into Julia's Compiler.jl code, where we can most likely maintain them much better going forward. See descriptions in the individual commits for some of the specifics of the changes and fixes, and how to change existing code to use these API correctly. In followup stages, most code relevant to precompile_utils, trim, and even the allocation-checker should consider being moved into Julia also now, since being written in C/C++ is currently providing negative value for maintaining those, and the change in the API boundary should now make that additional conversion easier. Gives a considerably smaller system image, despite having more code, by being better algorithms which avoid allocating permanent garbage: 155 MB -> 147MB in `.text` Makes a slightly larger Pkg.ji file cache, hopefully mainly due to being more strategic about what code is compiled (because that logic is mostly now in Julia instead of C), as it appear to have both inferred and compiled about 10% more code according to high level analysis of it: $ du -sh usr/share/julia/compiled/v1.12/ 237M # on PR 222M # on master
Author
Loading