[PATCH] D133780: [lld-macho] Have ICF dedup explicitly-defined selrefs

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 12:11:55 PDT 2022


thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.

Out of curiosity, do you have any numbers on what that does to the size gap for your apps?



================
Comment at: lld/MachO/ICF.cpp:417-423
+    bool isFoldableWithAddendsRemoved = isCfStringSection(isec) ||
+                                        isClassRefsSection(isec) ||
+                                        isSelRefsSection(isec);
+    // __objc_selrefs is typically marked as no_dead_strip but that doesn't stop
+    // ld64 from folding it
+    bool hasFoldableFlags = (isSelRefsSection(isec) ||
+                             sectionType(isec->getFlags()) == MachO::S_REGULAR);
----------------
Roger wrote:
> I really appreciate pulling out these boolean expressions into their own variables to give a name to what they represent. If it can be done any further, I'd really encourage it :)
+1, but maybe some of that could land in a separate (unreviewed, behavior-preserving) commit so it's easier to see the behavior change in this diff :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133780/new/

https://reviews.llvm.org/D133780



More information about the llvm-commits mailing list