summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2016-05-28 04:24:39 +0000
committerSean Silva <chisophugis@gmail.com>2016-05-28 04:24:39 +0000
commit42cc3422eb001b566c7e37c8e284298de7ac52ca (patch)
treea5d2a403341ae1dbf7f26839515f59ade5b6bef3 /llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
parent4f22c51b0975dec69de681e6346baa7c32a2f824 (diff)
downloadbcm5719-llvm-42cc3422eb001b566c7e37c8e284298de7ac52ca.tar.gz
bcm5719-llvm-42cc3422eb001b566c7e37c8e284298de7ac52ca.zip
Add a comment about why we need to buffer the attribute changes.
llvm-svn: 271097
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index a21409f0110..6168f9ef77d 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -901,6 +901,9 @@ static bool annotateAllFunctions(
}
M.setProfileSummary(Builder.getSummary()->getMD(M.getContext()));
// Set function hotness attribute from the profile.
+ // We have to apply these attributes at the end because their presence
+ // can affect the BranchProbabilityInfo of any callers, resulting in an
+ // inconsistent MST between prof-gen and prof-use.
for (auto &F : HotFunctions) {
F->addFnAttr(llvm::Attribute::InlineHint);
DEBUG(dbgs() << "Set inline attribute to function: " << F->getName()
OpenPOWER on IntegriCloud