[all-commits] [llvm/llvm-project] 905f65: [ELF] Replace getThreadIndex with explicit shards ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Jul 11 15:34:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 905f654bb721f1df119bd2cfaa23736e30838e90
      https://github.com/llvm/llvm-project/commit/905f654bb721f1df119bd2cfaa23736e30838e90
  Author: Fangrui Song <i at maskray.me>
  Date:   2026-07-11 (Sat, 11 Jul 2026)

  Changed paths:
    M lld/ELF/Arch/AArch64.cpp
    M lld/ELF/Arch/ARM.cpp
    M lld/ELF/Arch/Hexagon.cpp
    M lld/ELF/Arch/LoongArch.cpp
    M lld/ELF/Arch/Mips.cpp
    M lld/ELF/Arch/PPC.cpp
    M lld/ELF/Arch/PPC64.cpp
    M lld/ELF/Arch/RISCV.cpp
    M lld/ELF/Arch/SPARCV9.cpp
    M lld/ELF/Arch/SystemZ.cpp
    M lld/ELF/Arch/X86.cpp
    M lld/ELF/Arch/X86_64.cpp
    M lld/ELF/RelocScan.h
    M lld/ELF/Relocations.cpp
    M lld/ELF/SyntheticSections.h
    M lld/ELF/Target.h

  Log Message:
  -----------
  [ELF] Replace getThreadIndex with explicit shards in RelocScan. NFC (#208959)

Parallel relocation scanning (https://reviews.llvm.org/D133003) appends
dynamic relocations to `relocsVec[parallel::getThreadIndex()]`.
`getThreadIndex` returns -1u on main, which is a known hazard.

Instead, run one scan task per worker via `parallelFor`, with tasks
claiming object files off a shared counter, and pass the task index
through scanSection/RelocScan as the relocsVec shard.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list