aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2022-09-23 06:43:07 -0700
committerTeresa Johnson <tejohnson@google.com>2022-09-23 11:38:47 -0700
commitb1926f308f0939b365ee4940c7b1bd984b45e71a (patch)
tree5f286abdcff97723c4568ef0e019ba9a44bcee22 /clang/lib/Frontend/CompilerInvocation.cpp
parent79565766be94f7944278671a9f473d79ac18f7e1 (diff)
downloadllvm-b1926f308f0939b365ee4940c7b1bd984b45e71a.zip
llvm-b1926f308f0939b365ee4940c7b1bd984b45e71a.tar.gz
llvm-b1926f308f0939b365ee4940c7b1bd984b45e71a.tar.bz2
Restore "[MemProf] Memprof profile matching and annotation"
This reverts commit 794b7ea960ccc3222f2af582efadbc5e5c464292, and thus restores commit a212d8da94d08e229aa8d65283e4b116310bba10, and follow on fixes 0cd6763fa93159b84d70a5bb602c24996acaafaa, e9ff53d42feac7fc157718523275619a8106f2f3, and 37c6a25e9ab230e5e21fa34e246d9fec55275df0. Use a hash function (BLAKE3) instead of hash_combine/hash_code which are not guaranteed to be stable across executions. Additionally, it adds a "REQUIRES: x86_64-linux" to the tests that have raw profile inputs to avoid failures on big endian bots. Reviewers: snehasish, davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D128142
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 9f92410..656e595 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1306,7 +1306,10 @@ static void setPGOUseInstrumentor(CodeGenOptions &Opts,
}
std::unique_ptr<llvm::IndexedInstrProfReader> PGOReader =
std::move(ReaderOrErr.get());
- if (PGOReader->isIRLevelProfile()) {
+ // Currently memprof profiles are only added at the IR level. Mark the profile
+ // type as IR in that case as well and the subsequent matching needs to detect
+ // which is available (might be one or both).
+ if (PGOReader->isIRLevelProfile() || PGOReader->hasMemoryProfile()) {
if (PGOReader->hasCSIRLevelProfile())
Opts.setProfileUse(CodeGenOptions::ProfileCSIRInstr);
else