diff options
author | Dehao Chen <dehao@google.com> | 2017-03-23 23:14:11 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-03-23 23:14:11 +0000 |
commit | 775341a14ca7dc940a0e66fb637ec47fc7d86337 (patch) | |
tree | d71ef3a3c9fb77342087cf18d84b96dc154dacc9 /llvm/lib/CodeGen | |
parent | 10fbac009d007fc11c92a5dc5b2fbf07781fd139 (diff) | |
download | bcm5719-llvm-775341a14ca7dc940a0e66fb637ec47fc7d86337.tar.gz bcm5719-llvm-775341a14ca7dc940a0e66fb637ec47fc7d86337.zip |
Use isFunctionHotInCallGraph to set the function section prefix.
Summary: The current prefix based function layout algorithm only looks at function's entry count, which is not sufficient. A function should be grouped together if its entry count or any call edge count is hot.
Reviewers: davidxl, eraman
Reviewed By: eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31225
llvm-svn: 298656
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 93d1b7a1243..0d1f2c7a380 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -270,9 +270,9 @@ bool CodeGenPrepare::runOnFunction(Function &F) { if (ProfileGuidedSectionPrefix) { ProfileSummaryInfo *PSI = getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI(); - if (PSI->isFunctionEntryHot(&F)) + if (PSI->isFunctionHotInCallGraph(&F)) F.setSectionPrefix(".hot"); - else if (PSI->isFunctionEntryCold(&F)) + else if (PSI->isFunctionColdInCallGraph(&F)) F.setSectionPrefix(".cold"); } |