[ELF] Dump symbols ordered by profiled guided section layout to file.
authorRui Ueyama <ruiu@google.com>
Wed, 27 Mar 2019 23:52:22 +0000 (23:52 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 27 Mar 2019 23:52:22 +0000 (23:52 +0000)
commit432030e843bf124b4d285874362b6fd00446dd56
tree62f3f21cd270b2d41ae2dce0b14565a9b20d3da0
parent929932954d0f481e7e6602001ed7a3f0151774aa
[ELF] Dump symbols ordered by profiled guided section layout to file.

Patch by Tiancong Wang.

In D36351, Call-Chain Clustering (C3) heuristic is implemented with
option --call-graph-ordering-file <file>.
This patch adds a flag --print-symbol-order=<file> to LLD, and when
specified, it prints out the symbols ordered by the heuristics to the
file. The symbols printout is helpful to those who want to understand
the heuristics and want to reproduce the ordering with
--symbol-ordering-file in later pass.

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

llvm-svn: 357133
lld/ELF/CallGraphSort.cpp
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/Options.td
lld/test/ELF/cgprofile-print.s [new file with mode: 0644]
lld/test/ELF/cgprofile-reproduce.s [new file with mode: 0644]