[PATCH] D133003: [ELF] Parallelize relocation scanning

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 09:34:16 PDT 2022


andrewng added a comment.

I've created D133431 <https://reviews.llvm.org/D133431> which is the result of my experimentation thus far. In my testing, it does slightly improve performance in the test cases that regressed in performance. In other test cases, it's around the same or slightly lower performance increase. However, I can't help but feel there should be a "better" solution. Although, I guess you've always got to balance that with complexity/maintainability. The hard coded concurrency limit of 8 tasks in D133431 <https://reviews.llvm.org/D133431> also doesn't feel great.

> Thanks for catching the issue. Perhaps we can add a `thread_local` thread index (for `getDefaultExecutor`) to llvm/Support/Parallel.h and allocate a relocation vector for each thread. Finally merge and sort the relocation vectors.

Yes, trying to eliminate the lock contention does sound like a good approach, although it feels like it would add complexity.

Also forgot to mention that there were 2 other `ELF` tests that seemed to need the `--threads=1` treatment: `comdat-discarded-error.s` and `debug-line-obj.s`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133003



More information about the llvm-commits mailing list