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

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 11 13:02:30 PST 2015


beanz created this revision.
beanz added reviewers: dexonsmith, silvas, friss, vsk, bogner, cmatthews.
beanz added a subscriber: cfe-commits.

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

http://reviews.llvm.org/D15462

Files:
  CMakeLists.txt
  utils/perf-training/CMakeLists.txt
  utils/perf-training/README.txt
  utils/perf-training/cxx/hello_world.cpp
  utils/perf-training/lit.cfg
  utils/perf-training/lit.site.cfg.in

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15462.42561.patch
Type: text/x-patch
Size: 5295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151211/1a8e0af8/attachment-0001.bin>


More information about the cfe-commits mailing list