[CMake] Add support for generating profdata for clang from training files

Description

[CMake] Add support for generating profdata for clang from training files

Summary:
This patch adds support for using LIT to drive generating PGO profile data for clang.

This first pass implementation should work on Linux and Unix based platforms. If you build clang using CMake with LLVM_BUILD_INSTRUMENTED=On the CMake build generates a generate-profdata target that will use the just-built clang to build any test files (see hello_world.cpp as an example). Each test compile will generate profraw files for each clang process. After all tests have run CMake will merge the profraw files using llvm-profdata.

Future opportunities for extension:

  • Support for Build->Profile->Build bootstrapping
  • Support for linker order file generation using a similar mechanism and the same training data
  • Support for Windows

Reviewers: dexonsmith, friss, bogner, cmatthews, vsk, silvas

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15462

Details

Committed
cbienemanDec 15 2015, 5:02 PM
Differential Revision
D15462: [CMake] Add support for generating profdata for clang from training files
Parents
rL255739: [EarlyCSE] DSE of stores which write back loaded values
Branches
Unknown
Tags
Unknown