1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[PGO] Adjust -vp-counters-per-site under dynamic linking.

Addressing clang bootstrap under the dynamic linking mode running out of static
allocation of value profile nodes, reported in D81682.

Differential Revision: https://reviews.llvm.org/D92669
This commit is contained in:
Hiroshi Yamauchi 2020-12-09 15:04:55 -08:00
parent 15b1228eb3
commit a4a8865fc2

View File

@ -917,6 +917,15 @@ if (LLVM_BUILD_INSTRUMENTED)
CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
endif()
# Set this to avoid running out of the value profile node section
# under clang in dynamic linking mode.
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND
LLVM_LINK_LLVM_DYLIB)
append("-Xclang -mllvm -Xclang -vp-counters-per-site=1.5"
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS)
endif()
elseif(uppercase_LLVM_BUILD_INSTRUMENTED STREQUAL "CSIR")
append("-fcs-profile-generate=\"${LLVM_CSPROFILE_DATA_DIR}\""
CMAKE_CXX_FLAGS