• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/lld/ELF/

Lines Matching defs:ICF

1 //===- ICF.cpp ------------------------------------------------------------===//
9 // ICF is short for Identical Code Folding. This is a size optimization to
14 // In ICF, two sections are considered identical if they have the same
18 // terms of ICF*.
21 // same machine instructions, ICF can and should merge the two, although
63 // boost when applying ICF on large programs. For example, MSVC link.exe
64 // or GNU gold takes 10-20 seconds to apply ICF on Chromium, whose output
66 // 2.8 GHz 40 core machine. Even without threading, LLD's ICF is still
69 // [1] Safe ICF: Pointer Safe and Unwinding aware Identical Code Folding
75 #include "ICF.h"
99 template <class ELFT> class ICF {
161 // Returns true if section S is subject of ICF.
172 // SHF_LINK_ORDER sections are ICF'd as a unit with their dependent sections,
173 // so we don't consider them for ICF individually.
178 // The Data member needs to be valid for ICF as it is used by ICF to determine
189 // __start_* and __stop_* symbols. We cannot ICF any such sections because
199 void ICF<ELFT>::segregate(size_t begin, size_t end, bool constant) {
237 bool ICF<ELFT>::constantEq(const InputSection *secA, ArrayRef<RelTy> ra,
311 bool ICF<ELFT>::equalsConstant(const InputSection *a, const InputSection *b) {
328 // relocations point to the same section in terms of ICF.
331 bool ICF<ELFT>::variableEq(const InputSection *secA, ArrayRef<RelTy> ra,
368 bool ICF<ELFT>::equalsVariable(const InputSection *a, const InputSection *b) {
375 template <class ELFT> size_t ICF<ELFT>::findBoundary(size_t begin, size_t end) {
389 void ICF<ELFT>::forEachClassRange(size_t begin, size_t end,
400 void ICF<ELFT>::forEachClass(llvm::function_ref<void(size_t, size_t)> fn) {
454 // The main function of ICF.
455 template <class ELFT> void ICF<ELFT>::run() {
498 log("ICF needed " + Twine(cnt) + " iterations");
518 // ICF may fold some input sections assigned to output sections. Remove them.
527 // ICF entry point function.
529 llvm::TimeTraceScope timeScope("ICF");
530 ICF<ELFT>().run();