Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
PGO: Disable instrumentation pre-inlining pass by default. #64095
LLVM's IR-level instrumention feature (which is used for PGO) has a pre-inlining pass. This pass performs some initial inlining and other small cheap optimizations before adding the instrumentation counters to the IR. For C++ code compiled with Clang this seems to have pretty significant benefits (see e.g. what happens if pre-inlining is turned off for C/C++ code in Firefox). For Rust code, however, this does not seem to be true.
So far, PGO seems to be rather ineffective for Rust code in general, but with pre-inlining enabled, it seems to even be detrimental to performance in most cases. E.g. when optimizing the
So PGO is able eke out a ~1% speedup, if pre-inlining is disabled, but if it is enabled, the benchmarks run usually slower than without PGO. For doing benchmarks with FF, the picture is similar.
PGO's effectiveness with Rust should be investigated more deeply in any case, but for now this PR defaults to disable pre-inlining. It can be enabled on a case by case basis via
This PR also removes the