-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
BOLTgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributehelp wantedIndicates that a maintainer wants help. Not [good first issue].Indicates that a maintainer wants help. Not [good first issue].
Description
Operations with symbols such as name lookup are expensive and some binaries have millions of symbols, so it makes sense to try to reduce the symbol-related overheads.
Measure how much the following cost and refactor/eliminate:
- Checks for symbol name being equal to __asan_init and __llvm_coverage_mapping for every single symbol:
llvm-project/bolt/lib/Rewrite/RewriteInstance.cpp
Lines 824 to 837 in a1423ba
for (const ELFSymbolRef &Symbol : InputFile->symbols()) { Expected<StringRef> NameOrError = Symbol.getName(); if (NameOrError && NameOrError->starts_with("__asan_init")) { BC->errs() << "BOLT-ERROR: input file was compiled or linked with sanitizer " "support. Cannot optimize.\n"; exit(1); } if (NameOrError && NameOrError->starts_with("__llvm_coverage_mapping")) { BC->errs() << "BOLT-ERROR: input file was compiled or linked with coverage " "support. Cannot optimize.\n"; exit(1); } - FileName set for every local function symbol (with O(1M) for large binaries) while we can instead use file symbol lookup with O(log N_Syms) cost and FileSyms memory cost [BOLT][NFCI] Use FileSymbols for local symbol disambiguation #89088
- Merge iteration over two loops over symbols into one: and
for (const ELFSymbolRef &Symbol : InputFile->symbols()) { for (const SymbolRef &Symbol : InputFile->symbols())
Metadata
Metadata
Assignees
Labels
BOLTgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributehelp wantedIndicates that a maintainer wants help. Not [good first issue].Indicates that a maintainer wants help. Not [good first issue].