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

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 18:52:31 PDT 2017


davidxl 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
----------------
vsk wrote:
> 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?
"Would you prefer finding the dirname of LLVM_PROFILE_FILE_PATTERN, and using that instead?" -- that seems better -- to avoid exposing -fprofile-instrument-path


https://reviews.llvm.org/D38066





More information about the llvm-commits mailing list