summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-12-16 16:48:46 +0000
committerDehao Chen <dehao@google.com>2016-12-16 16:48:46 +0000
commit27978005955754bf11b71766c08b768e9fb5c040 (patch)
tree7ee54ef41a986925931598c40509827b21846d19 /llvm/lib/LTO/LTO.cpp
parentc3d0165c494a6323a8e293cf1b3b3e46764be095 (diff)
downloadbcm5719-llvm-27978005955754bf11b71766c08b768e9fb5c040.tar.gz
bcm5719-llvm-27978005955754bf11b71766c08b768e9fb5c040.zip
Pass sample pgo flags to thinlto.
Summary: ThinLTO needs to invoke SampleProfileLoader pass during link time in order to annotate profile correctly after module importing. Reviewers: davidxl, mehdi_amini, tejohnson Subscribers: pcc, davide, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D27790 llvm-svn: 289957
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 74de6c18aef..09198591da9 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -129,6 +129,12 @@ static void computeCacheKey(
ArrayRef<uint8_t>((const uint8_t *)&Linkage, sizeof(Linkage)));
}
+ if (!Conf.SampleProfile.empty()) {
+ auto FileOrErr = MemoryBuffer::getFile(Conf.SampleProfile);
+ if (FileOrErr)
+ Hasher.update(FileOrErr.get()->getBuffer());
+ }
+
Key = toHex(Hasher.result());
}
OpenPOWER on IntegriCloud