[PATCH] D47249: [ELF] Implement --icf=safe

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 11:59:04 PDT 2018


ruiu added a comment.

As you know, I also experimented the same idea to merge ctors/dtors (which I shared with you as https://reviews.llvm.org/D47034), and what I noticed was that the size reduction by this version of safe ICF is negligible. When I link Firefox with my patch, I observed only 0.16% size reduction.

I have another concern about the gold-style safe ICF. Gold's safe ICF is inherently hacky as it depends on heuristics which are not really guaranteed by any compiler or standard, and that's inherently slow because it needs to collect evidences form many places to determine whether a section seems to safe to merge or not. Since Peter now has a proposal of doing it in a better, controlled manner, I personally don't want to add the gold-style safe ICF to lld. Once we add some feature, we can't delete a feature in practice. We'll have to live with it in the foreseeable future. So eventually we'd have two safe ICFs if we add gold's ICF now. I'd like to err on the conservative side to not add a lesser one if some better one is coming.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47249





More information about the llvm-commits mailing list