[PATCH] D57985: [test-suite] Add cmake option to use IR PGO (TEST_SUITE_USE_IR_PGO)

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 8 16:54:48 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353591: [test-suite] Add cmake option to use IR PGO (TEST_SUITE_USE_IR_PGO) (authored by vedantk, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D57985?vs=186067&id=186076#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57985/new/

https://reviews.llvm.org/D57985

Files:
  test-suite/trunk/CMakeLists.txt
  test-suite/trunk/litsupport/README.md


Index: test-suite/trunk/CMakeLists.txt
===================================================================
--- test-suite/trunk/CMakeLists.txt
+++ test-suite/trunk/CMakeLists.txt
@@ -94,6 +94,8 @@
   endif()
 endif()
 
+option(TEST_SUITE_USE_IR_PGO
+  "Use IR PGO instrumentation (requires TEST_SUITE_PROFILE_GENERATE)" OFF)
 
 # Enable profile generate mode in lit. Note that this does not automatically
 # add something like -fprofile-instr-generate to the compiler flags.
@@ -109,9 +111,15 @@
   endif()
 
   set(TEST_SUITE_PROFILE_GENERATE "True")
-  list(APPEND CFLAGS -fprofile-instr-generate)
-  list(APPEND CXXFLAGS -fprofile-instr-generate)
-  list(APPEND LDFLAGS -fprofile-instr-generate)
+
+  set(profile_instrumentation_flags -fprofile-instr-generate)
+  if(TEST_SUITE_USE_IR_PGO)
+    set(profile_instrumentation_flags -fprofile-generate)
+  endif()
+
+  list(APPEND CFLAGS   ${profile_instrumentation_flags})
+  list(APPEND CXXFLAGS ${profile_instrumentation_flags})
+  list(APPEND LDFLAGS  ${profile_instrumentation_flags})
 else()
   set(TEST_SUITE_PROFILE_GENERATE "False")
 endif()
Index: test-suite/trunk/litsupport/README.md
===================================================================
--- test-suite/trunk/litsupport/README.md
+++ test-suite/trunk/litsupport/README.md
@@ -70,7 +70,8 @@
   ssh to run benchmarks on a remote device (assuming shared file systems).
 - `cmake -DTEST_SUITE_PROFILE_GENERATE` compiles benchmark with
   `-fprofile-instr-generate` and enables the `profilegen` module that runs
-  `llvm-profdata` after running the benchmarks.
+  `llvm-profdata` after running the benchmarks. To use LLVM IR PGO instead of
+  the clang frontend's PGO feature, set `-DTEST_SUITE_USE_IR_PGO=On`.
 
 Available modules are found in the `litsupport/modules` directory.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57985.186076.patch
Type: text/x-patch
Size: 1803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190209/7a320674/attachment-0001.bin>


More information about the llvm-commits mailing list