This allows building programs in the test suite with LLVM's IR PGO
feature. Support for re-building programs with the collected profdata is
already present.
E.g, to build for training:
$ cmake -G Ninja -DCMAKE_C_COMPILER=$CC -C ~/src/llvm-test-suite/cmake/caches/target-arm64-iphoneos-internal.cmake -C ~/src/llvm-test-suite/cmake/caches/ReleaseLTO.cmake ~/src/llvm-test-suite -DTEST_SUITE_REMOTE_HOST=device -DTEST_SUITE_PROFILE_GENERATE=On -DTEST_SUITE_USE_IR_PGO=On -DTEST_SUITE_BENCHMARKING_ONLY=On -DTEST_SUITE_RUN_TYPE=train
To collect profile data: ninja && ninja rsync && llvm-lit .
To re-build with training data present, just re-configure and re-run ninja:
$ cmake -G Ninja -DCMAKE_C_COMPILER=$CC -C ~/src/llvm-test-suite/cmake/caches/target-arm64-iphoneos-internal.cmake -C ~/src/llvm-test-suite/cmake/caches/ReleaseLTO.cmake ~/src/llvm-test-suite -DTEST_SUITE_REMOTE_HOST=device -DTEST_SUITE_PROFILE_GENERATE=Off -DTEST_SUITE_BENCHMARKING_ONLY=On -DTEST_SUITE_RUN_TYPE=ref -DTEST_SUITE_PROFILE_USE=On