HomePhabricator

[ELF] Add profile guided section layout

Description

[ELF] Add profile guided section layout

This adds profile guided layout using the Call-Chain Clustering (C³) heuristic
from https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.pdf .

RFC: [llvm-dev] [RFC] Profile guided section layout

http://lists.llvm.org/pipermail/llvm-dev/2017-June/114178.html

Pass --call-graph-ordering-file <file> to read a call graph profile where each
line has the format:

<from symbol> <to symbol> <call count>

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