[all-commits] [llvm/llvm-project] c32f39: Detect Source Drift with Propeller.

Sriraman Tallam via All-commits all-commits at lists.llvm.org
Fri Jan 29 19:16:09 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c32f3998029d52df33d060e759563e3d314ce29f
  Author: Sriraman Tallam <tmsriram at google.com>
  Date:   2021-01-29 (Fri, 29 Jan 2021)

  Changed paths:
    M llvm/lib/CodeGen/BasicBlockSections.cpp
    A llvm/test/CodeGen/X86/basic-block-sections-source-drift.ll

  Log Message:
  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

Differential Revision: https://reviews.llvm.org/D95593

More information about the All-commits mailing list