[PATCH] D38066: [cmake] Add an option to build llvm with IR PGO

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 18:21:30 PDT 2017


vsk added inline comments.


================
Comment at: cmake/modules/HandleLLVMOptions.cmake:751
+mark_as_advanced(LLVM_ENABLE_IR_PGO)
+append_if(LLVM_ENABLE_IR_PGO "-fprofile-generate -Xclang -fprofile-instrument-path='${LLVM_PROFILE_FILE_PATTERN}'"
+  CMAKE_CXX_FLAGS
----------------
davidxl wrote:
> -fprofile-generate=<> is supported as well, why not using that?
That flag treats its argument as a directory and appends '/default_%m.profraw'. It's not possible to use it along with LLVM_PROFILE_FILE_PATTERN off-the-shelf, as that would introduce multiple %Nm specifiers.

Would you prefer finding the dirname of LLVM_PROFILE_FILE_PATTERN, and using that instead?


https://reviews.llvm.org/D38066





More information about the llvm-commits mailing list