Add support for Profile-Guided Optimizations (PGO) #650
Labels
compiler
Changes related to the compiler
feature
New things to add to Inko, such as a new standard library module
performance
Changes related to improving performance
Description
Profile-Guided Optimization (PGO) is a compiler optimization technique that uses runtime profile information for more aggressive optimizations during the compile time. PGO is not a novel optimization technique - it's already supported by many compilers like Rustc, GCC, Clang, MSVC, Go, etc.
We need to add PGO support to the Inko compiler, so users will be able to compile their programs in Inko lang with this optimization. LLVM already supports many PGO kinds - information about them can be found at https://aaupov.github.io/blog/2023/07/09/pgo . I think the PGO integration into the Inko compiler could done in the same way as it's done for Rustc/Clang (since they are both LLVM-based) - with introducing additional compiler optimization options like
-fprofile-instr-generate
/-fprofile-instr-use
(in the case of Instrumentation PGO).In my opinion, the most useful PGO ways in practice are Instrumentation PGO and Sampling PGO (also sometimes called as AutoFDO).
Related work
Many materials about PGO effects on the performance software, support across the ecosystem, etc. can be found in the https://github.com/zamazan4ik/awesome-pgo repo.
The text was updated successfully, but these errors were encountered: