[PATCH] D130134: [lld-macho] Fold cfstrings with --deduplicate-literals

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 08:14:18 PDT 2022


keith added inline comments.


================
Comment at: lld/MachO/ICF.cpp:403
 
-void macho::foldIdenticalSections() {
+void macho::foldIdenticalSections(bool onlyCfStrings) {
   TimeTraceScope timeScope("Fold Identical Code Sections");
----------------
int3 wrote:
> keith wrote:
> > I'm not happy with hijacking this function for this specific use case, so it would probably make sense for me to try to extract something here
> yeah that would be nice but no rush
Ok thanks, we can see how this evolves a bit then I guess


================
Comment at: lld/test/MachO/cfstring-dedup.s:40-51
+# LITERALS-ONLY:       Rebase table:
+# LITERALS-ONLY-NEXT:  segment  section          address  type
+# LITERALS-ONLY-NEXT:  __DATA_CONST __cfstring   {{.*}}   pointer
+# LITERALS-ONLY-NEXT:  __DATA_CONST __cfstring   {{.*}}   pointer
+# LITERALS-ONLY-NEXT:  __DATA_CONST __cfstring   {{.*}}   pointer
+# LITERALS-ONLY-EMPTY:
+# LITERALS-ONLY-NEXT:  Bind table:
----------------
int3 wrote:
> isn't this identical to the `CHECK` lines above? don't think we need to define a separate CHECK prefix
So this part is, but the first CHECK block isn't valid for this codepath, since it expects __TEXT,__text folding as well. I've combined these to avoid the duplication and pointed the original test to both prefixes, wdyt?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130134



More information about the llvm-commits mailing list