Page MenuHomePhabricator

[test-suite] Add cmake option to use IR PGO (TEST_SUITE_USE_IR_PGO)
ClosedPublic

Authored by vsk on Feb 8 2019, 4:15 PM.

Details

Summary

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

Diff Detail

Event Timeline

vsk created this revision.Feb 8 2019, 4:15 PM
vsk retitled this revision from Add cmake option to use IR PGO (TEST_SUITE_USE_IR_PGO) to [test-suite] Add cmake option to use IR PGO (TEST_SUITE_USE_IR_PGO).Feb 8 2019, 4:15 PM
anemet accepted this revision.Feb 8 2019, 4:24 PM

LGTM

This revision is now accepted and ready to land.Feb 8 2019, 4:24 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2019, 4:54 PM