1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Fix code section prefix for proper layout

Summary:
r284533 added hot and cold section prefixes based on profile
information, to enable grouping of hot/cold functions at link time.
However, it used "cold" as the prefix for cold sections, but gold only
recognizes "unlikely" (which is used by gcc for cold sections).
Therefore, cold sections were not properly being grouped. Switch to
using "unlikely"

Reviewers: danielcdh, davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32983

llvm-svn: 302502
This commit is contained in:
Teresa Johnson 2017-05-09 01:43:24 +00:00
parent 59a98b05ce
commit 7ff9f7abb3
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
if (PSI->isFunctionHotInCallGraph(&F))
F.setSectionPrefix(".hot");
else if (PSI->isFunctionColdInCallGraph(&F))
F.setSectionPrefix(".cold");
F.setSectionPrefix(".unlikely");
}
/// This optimization identifies DIV instructions that can be

View File

@ -35,7 +35,7 @@ define void @cold_func() !prof !16 {
}
; CHECK: ![[HOT_ID]] = !{!"function_section_prefix", !".hot"}
; CHECK: ![[COLD_ID]] = !{!"function_section_prefix", !".cold"}
; CHECK: ![[COLD_ID]] = !{!"function_section_prefix", !".unlikely"}
!llvm.module.flags = !{!1}
!1 = !{i32 1, !"ProfileSummary", !2}
!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}