diff options
| author | Diego Novillo <dnovillo@google.com> | 2015-11-20 15:39:42 +0000 |
|---|---|---|
| committer | Diego Novillo <dnovillo@google.com> | 2015-11-20 15:39:42 +0000 |
| commit | df544a098aa63aca5c1830ac1cfd19fbdb5b9f7f (patch) | |
| tree | 2bd45fc260ee7aea00318eb477870e1e831691ee /llvm/lib/Transforms | |
| parent | 7fa524b4b874529bff9b93b1783bcb29924c782f (diff) | |
| download | bcm5719-llvm-df544a098aa63aca5c1830ac1cfd19fbdb5b9f7f.tar.gz bcm5719-llvm-df544a098aa63aca5c1830ac1cfd19fbdb5b9f7f.zip | |
SamplePGO - Add line offset and discriminator information to sample reports.
While debugging some sampling coverage problems, I found this useful:
When applying samples from a profile, it helps to also know what line
offset and discriminator the sample belongs to. This makes it easy to
correlate against the input profile.
llvm-svn: 253670
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/SampleProfile.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index 5979f022bc6..df8c8a0f7c4 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -344,9 +344,11 @@ SampleProfileLoader::getInstWeight(const Instruction &Inst) const { if (FirstMark) { const Function *F = Inst.getParent()->getParent(); LLVMContext &Ctx = F->getContext(); - emitOptimizationRemark(Ctx, DEBUG_TYPE, *F, DLoc, - Twine("Applied ") + Twine(*R) + - " samples from profile"); + emitOptimizationRemark( + Ctx, DEBUG_TYPE, *F, DLoc, + Twine("Applied ") + Twine(*R) + " samples from profile (offset: " + + Twine(LineOffset) + + ((Discriminator) ? Twine(".") + Twine(Discriminator) : "") + ")"); } DEBUG(dbgs() << " " << Lineno << "." << DIL->getDiscriminator() << ":" << Inst << " (line offset: " << Lineno - HeaderLineno << "." |

