Skip to content

Commit 60b3e05

Browse files
committed
[ELF] Restore the --call-graph-profile-sort=hfsort default before #68638
The high time complexity of cache-directed sort is a real issue and is not appropriate as the default, at least for now (#68638 (comment)).
1 parent 398e48a commit 60b3e05

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lld/ELF/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ static void ltoValidateAllVtablesHaveTypeInfos(opt::InputArgList &args) {
10951095
}
10961096

10971097
static CGProfileSortKind getCGProfileSortKind(opt::InputArgList &args) {
1098-
StringRef s = args.getLastArgValue(OPT_call_graph_profile_sort, "cdsort");
1098+
StringRef s = args.getLastArgValue(OPT_call_graph_profile_sort, "hfsort");
10991099
if (s == "hfsort")
11001100
return CGProfileSortKind::Hfsort;
11011101
if (s == "cdsort")

lld/docs/ld.lld.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ may be:
128128
.It Cm none
129129
Ignore call graph profile.
130130
.It Cm hfsort
131-
Use hfsort.
131+
Use hfsort (default).
132132
.It Cm cdsort
133-
Use cdsort (default).
133+
Use cdsort.
134134
.El
135135
.Pp
136136
.It Fl -color-diagnostics Ns = Ns Ar value

lld/test/ELF/cgprofile-txt.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
# RUN: echo "TooManyPreds10 TooManyPreds 11" >> %t.call_graph
2727
# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=hfsort -o %t2
2828
# RUN: llvm-readobj --symbols %t2 | FileCheck %s
29+
## --call-graph-profile-sort=hfsort is the default.
30+
# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2b
31+
# RUN: cmp %t2 %t2b
2932

3033
# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=cdsort -o %t2
3134
# RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=CDSORT
32-
## --call-graph-profile-sort=cdsort is the default.
33-
# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2b
34-
# RUN: cmp %t2 %t2b
3535

3636
# RUN: not ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=sort \
3737
# RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNKNOWN

0 commit comments

Comments
 (0)