Detect Source Drift with Propeller.
authorSriraman Tallam <tmsriram@google.com>
Sat, 30 Jan 2021 02:47:26 +0000 (18:47 -0800)
committerSriraman Tallam <tmsriram@google.com>
Sat, 30 Jan 2021 02:47:26 +0000 (18:47 -0800)
commitc32f3998029d52df33d060e759563e3d314ce29f
tree9cc1bad58582249f883ffb20b97f34698735a06c
parent4d9336923ec33ff789ed0f32dd0d13a4f902b3aa
Detect Source Drift with Propeller.

Source Drift happens when the sources are updated after profiling the binary
but before building the final optimized binary. If the source has changed since
the profiles were obtained, optimizing basic blocks might be sub-optimal. This
only applies to BasicBlockSection::List as it creates clusters of basic blocks
using basic block ids. Source drift can invalidate these groupings leading to
sub-optimal code generation with regards to performance.

PGO source drift for a particular function can be detected using function
metadata added in D95495.

When source drift is deected, disable basic block clusters by default
which can be re-enabled with  -mllvm option
bbsections-detect-source-drift=false.

Differential Revision: https://reviews.llvm.org/D95593
llvm/lib/CodeGen/BasicBlockSections.cpp
llvm/test/CodeGen/X86/basic-block-sections-source-drift.ll [new file with mode: 0644]