[all-commits] [llvm/llvm-project] b42f96: [lld] Add thunks for hexagon (#111217)

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Jul 20 11:05:43 PDT 2025


  Branch: refs/heads/users/MaskRay/spr/mc-clean-up-code-related-to-fragments
  Home:   https://github.com/llvm/llvm-project
  Commit: b42f96bc057fd9e31572069b241ba130c21144e5
      https://github.com/llvm/llvm-project/commit/b42f96bc057fd9e31572069b241ba130c21144e5
  Author: Brian Cain <brian.cain at oss.qualcomm.com>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M lld/ELF/Arch/Hexagon.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/Thunks.cpp
    R lld/test/ELF/hexagon-jump-error.s
    A lld/test/ELF/hexagon-thunk-range-b22rel.s
    A lld/test/ELF/hexagon-thunk-range-gdplt.s
    A lld/test/ELF/hexagon-thunk-range-plt.s
    A lld/test/ELF/hexagon-thunks-packets.s
    A lld/test/ELF/hexagon-thunks.s

  Log Message:
  -----------
  [lld] Add thunks for hexagon (#111217)

Without thunks, programs will encounter link errors complaining that the
branch target is out of range. Thunks will extend the range of branch
targets, which is a critical need for large programs. Thunks provide
this flexibility at a cost of some modest code size increase.

When configured with the maximal feature set, the hexagon port of the
linux kernel would often encounter these limitations when linking with
`lld`.

The relocations which will be extended by thunks are:

* R_HEX_B22_PCREL, R_HEX_{G,L}D_PLT_B22_PCREL, R_HEX_PLT_B22_PCREL
relocations have a range of ± 8MiB on the baseline
* R_HEX_B15_PCREL: ±65,532 bytes
* R_HEX_B13_PCREL: ±16,380 bytes
* R_HEX_B9_PCREL: ±1,020 bytes

Fixes #149689 

Co-authored-by: Alexey Karyakin <akaryaki at quicinc.com>

---------

Co-authored-by: Alexey Karyakin <akaryaki at quicinc.com>


  Commit: 343f7475bed009e31ad1d5655f462d53e46ca9fa
      https://github.com/llvm/llvm-project/commit/343f7475bed009e31ad1d5655f462d53e46ca9fa
  Author: Jasmine Tang <jjasmine at igalia.com>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h
    A llvm/test/CodeGen/WebAssembly/memcmp-expand.ll

  Log Message:
  -----------
  [WebAssembly] Add support for memcmp expansion (#148298)

Fixes https://github.com/llvm/llvm-project/issues/61400

Added test case in llvm/test/CodeGen/WebAssembly/memcmp-expand.ll


  Commit: 6201761e961f4d7ed08352d55134e6ef58ee5eb2
      https://github.com/llvm/llvm-project/commit/6201761e961f4d7ed08352d55134e6ef58ee5eb2
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCSection.h
    M llvm/include/llvm/MC/MCSectionGOFF.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/MC/MCAssembler.cpp
    M llvm/lib/MC/MCMachOStreamer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCSection.cpp
    M llvm/lib/MC/MachObjectWriter.cpp
    M llvm/lib/ObjCopy/MachO/MachOObject.h
    M llvm/lib/ObjCopy/MachO/MachOWriter.cpp

  Log Message:
  -----------
  MC: Rename isVirtualSection to isBssSection

The term BSS (Block Started by Symbol) is a standard, widely recognized
term, available in the a.out object file format and adopted by formats
like COFF, XCOFF, Mach-O (called S_ZEROFILL while `__bss` is also used),
and ELF. To avoid introducing unfamiliar terms, we should use
isBSSSection instead of isVirtualSection.


  Commit: ba6b705620053f8d1ffcb31e39209f1ef551ced0
      https://github.com/llvm/llvm-project/commit/ba6b705620053f8d1ffcb31e39209f1ef551ced0
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCObjectStreamer.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/lib/MC/MCWinCOFFStreamer.cpp
    M llvm/lib/MC/MCXCOFFStreamer.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp

  Log Message:
  -----------
  MC: Replace getOrCreateDataFragment with getCurrentFragment

Add an assert to ensure `CurFrag` is either null or an `FT_Data` fragment.

Follow-up to 39c8cfb70d203439e3296dfdfe3d41f1cb2ec551.
Extracted from #149721


  Commit: 2e6d029ec27cc1a5b8b89e7863f2823d08b8d452
      https://github.com/llvm/llvm-project/commit/2e6d029ec27cc1a5b8b89e7863f2823d08b8d452
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M lld/ELF/Arch/Hexagon.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/Thunks.cpp
    R lld/test/ELF/hexagon-jump-error.s
    A lld/test/ELF/hexagon-thunk-range-b22rel.s
    A lld/test/ELF/hexagon-thunk-range-gdplt.s
    A lld/test/ELF/hexagon-thunk-range-plt.s
    A lld/test/ELF/hexagon-thunks-packets.s
    A lld/test/ELF/hexagon-thunks.s
    M llvm/include/llvm/MC/MCSection.h
    M llvm/include/llvm/MC/MCSectionGOFF.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/MC/MCAssembler.cpp
    M llvm/lib/MC/MCMachOStreamer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCSection.cpp
    M llvm/lib/MC/MachObjectWriter.cpp
    M llvm/lib/ObjCopy/MachO/MachOObject.h
    M llvm/lib/ObjCopy/MachO/MachOWriter.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h
    A llvm/test/CodeGen/WebAssembly/memcmp-expand.ll

  Log Message:
  -----------
  land the getCurrentFragment change separately and then rebase

Created using spr 1.3.5-bogner


Compare: https://github.com/llvm/llvm-project/compare/1e95686eef70...2e6d029ec27c

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