[lld] [lld][ELF] Merge equivalent symbols found during ICF (PR #139493)

Pranav Kant via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 12:34:50 PDT 2025


================
@@ -286,9 +313,14 @@ bool ICF<ELFT>::constantEq(const InputSection *secA, Relocs<RelTy> ra,
     // Relocations referring to InputSections are constant-equal if their
     // section offsets are equal.
     if (isa<InputSection>(da->section)) {
-      if (da->value + addA == db->value + addB)
+      if (da->value + addA == db->value + addB) {
----------------
pranavk wrote:

Hmm. Thanks for clarification. I was under the impression that after my comment here (https://issues.chromium.org/issues/415810137#comment50), you tried it and confirmed it works but the size regression was not acceptable to you. 

I am okay simplifying the condition here after this clarification.

https://github.com/llvm/llvm-project/pull/139493


More information about the llvm-commits mailing list