[lld] 6827a00 - [lld][InstrProf] Do not use cstring offset hashes in function order for compression (#113606)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 09:47:25 PDT 2024


Author: SharonXSharon
Date: 2024-10-28T09:47:21-07:00
New Revision: 6827a00d4dfe1fa7d479337b6192602744055686

URL: https://github.com/llvm/llvm-project/commit/6827a00d4dfe1fa7d479337b6192602744055686
DIFF: https://github.com/llvm/llvm-project/commit/6827a00d4dfe1fa7d479337b6192602744055686.diff

LOG: [lld][InstrProf] Do not use cstring offset hashes in function order for compression (#113606)

Added: 
    

Modified: 
    lld/MachO/BPSectionOrderer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/BPSectionOrderer.cpp b/lld/MachO/BPSectionOrderer.cpp
index 07b44d48d65932..5db2242a35ef28 100644
--- a/lld/MachO/BPSectionOrderer.cpp
+++ b/lld/MachO/BPSectionOrderer.cpp
@@ -53,11 +53,8 @@ getRelocHash(const Reloc &reloc,
     kind = ("Section " + Twine(static_cast<uint8_t>(isec->kind()))).str();
   if (auto *sym = reloc.referent.dyn_cast<Symbol *>()) {
     kind += (" Symbol " + Twine(static_cast<uint8_t>(sym->kind()))).str();
-    if (auto *d = dyn_cast<Defined>(sym)) {
-      if (isa_and_nonnull<CStringInputSection>(isec))
-        return getRelocHash(kind, 0, isec->getOffset(d->value), reloc.addend);
+    if (auto *d = dyn_cast<Defined>(sym))
       return getRelocHash(kind, sectionIdx.value_or(0), d->value, reloc.addend);
-    }
   }
   return getRelocHash(kind, sectionIdx.value_or(0), 0, reloc.addend);
 }


        


More information about the llvm-commits mailing list