aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/SampleProf.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-03-03 18:09:32 +0000
committerDehao Chen <dehao@google.com>2016-03-03 18:09:32 +0000
commit57d1dda5581594ebdfabcb899bd224d037105a1a (patch)
tree6773547961c94d7a8218d714778f0e2086409f57 /llvm/lib/ProfileData/SampleProf.cpp
parent022afe253865ce20a9af2cb4dec31e10a3977aa6 (diff)
downloadllvm-57d1dda5581594ebdfabcb899bd224d037105a1a.zip
llvm-57d1dda5581594ebdfabcb899bd224d037105a1a.tar.gz
llvm-57d1dda5581594ebdfabcb899bd224d037105a1a.tar.bz2
Use LineLocation instead of CallsiteLocation to index callsite profile.
Summary: With discriminator, LineLocation can uniquely identify a callsite without the need to specifying callee name. Remove Callee function name from the key, and put it in the value (FunctionSamples). Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17827 llvm-svn: 262634
Diffstat (limited to 'llvm/lib/ProfileData/SampleProf.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProf.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp
index 5a69bb91..45e1679 100644
--- a/llvm/lib/ProfileData/SampleProf.cpp
+++ b/llvm/lib/ProfileData/SampleProf.cpp
@@ -73,19 +73,6 @@ raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS,
LLVM_DUMP_METHOD void LineLocation::dump() const { print(dbgs()); }
-void CallsiteLocation::print(raw_ostream &OS) const {
- LineLocation::print(OS);
- OS << ": inlined callee: " << CalleeName;
-}
-
-LLVM_DUMP_METHOD void CallsiteLocation::dump() const { print(dbgs()); }
-
-inline raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS,
- const CallsiteLocation &Loc) {
- Loc.print(OS);
- return OS;
-}
-
/// \brief Print the sample record to the stream \p OS indented by \p Indent.
void SampleRecord::print(raw_ostream &OS, unsigned Indent) const {
OS << NumSamples;
@@ -127,11 +114,11 @@ void FunctionSamples::print(raw_ostream &OS, unsigned Indent) const {
OS.indent(Indent);
if (CallsiteSamples.size() > 0) {
OS << "Samples collected in inlined callsites {\n";
- SampleSorter<CallsiteLocation, FunctionSamples> SortedCallsiteSamples(
+ SampleSorter<LineLocation, FunctionSamples> SortedCallsiteSamples(
CallsiteSamples);
for (const auto &CS : SortedCallsiteSamples.get()) {
OS.indent(Indent + 2);
- OS << CS->first << ": ";
+ OS << CS->first << ": inlined callee: " << CS->second.getName() << ": ";
CS->second.print(OS, Indent + 4);
}
OS << "}\n";