[all-commits] [llvm/llvm-project] 2ae3fa: [lld-macho] Sort LC_LINKER_OPTIONS before processi...

Vitaly Buka via All-commits all-commits at lists.llvm.org
Tue Jun 9 08:09:49 PDT 2026


  Branch: refs/heads/users/vitalybuka/spr/nfccfi-ignore-cfi-icall-for-diagnostichandlerh
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ae3fa77da6c393c5b47ced09b6d91551d178b57
      https://github.com/llvm/llvm-project/commit/2ae3fa77da6c393c5b47ced09b6d91551d178b57
  Author: Nuri Amari <nuri.amari99 at gmail.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/docs/ReleaseNotes.rst
    R lld/test/MachO/lc-linker-option-order.ll
    A lld/test/MachO/lc-linker-option-postprocess.ll
    A lld/test/MachO/lc-linker-option-sort.ll

  Log Message:
  -----------
  [lld-macho] Sort LC_LINKER_OPTIONS before processing (#201604)

Previously https://reviews.llvm.org/D157716 brought handling of
LC_LINKER_OPTIONS closer to Apple linker behavior by processing the
options at the end after all object files have been added.

This corrects another difference in behavior, processing frameworks
before regular libraries (linked with -lFoo), and processing each group
in sorted order.

Processing a LC_LINKER_OPTIONS can trigger loads of more object files
which in turn may have more LC_LINKER_OPTIONS. We iterate this to a
fixed point, walking this graph in BFS order, processing each "level" of
the graph in the order described above. This graph traversal order
hasn't changed in this commit, only the sorting has.

The diff of the linker map produced for the included test before and
after:
```
23,28c23,28
< 0x000003D0    0x00000001      [  4] _zlib
< 0x000003E0    0x00000001      [  5] _zed_framework
< 0x000003F0    0x00000001      [  6] _mlib
< 0x00000400    0x00000001      [  7] _alpha_framework
< 0x00000410    0x00000001      [  8] _alib
< 0x00000420    0x00000001      [  9] _mid_framework
---
> 0x000003D0    0x00000001      [  4] _alpha_framework
> 0x000003E0    0x00000001      [  5] _mid_framework
> 0x000003F0    0x00000001      [  6] _zed_framework
> 0x00000400    0x00000001      [  7] _alib
> 0x00000410    0x00000001      [  8] _mlib
> 0x00000420    0x00000001      [  9] _zlib
```

Apple's linker produces the same order as after.

---------

Co-authored-by: Nuri Amari <nuriamari at fb.com>


  Commit: cefb93799312e772f2d71529075bc4ab1b94b845
      https://github.com/llvm/llvm-project/commit/cefb93799312e772f2d71529075bc4ab1b94b845
  Author: Nick Sarnie <nick.sarnie at intel.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
    A llvm/test/CodeGen/SPIRV/ptrmask-logical.ll
    A llvm/test/CodeGen/SPIRV/ptrmask-vec.ll
    A llvm/test/CodeGen/SPIRV/ptrmask32.ll
    A llvm/test/CodeGen/SPIRV/ptrmask64-32.ll
    A llvm/test/CodeGen/SPIRV/ptrmask64.ll

  Log Message:
  -----------
  [SPIRV] Add support for G_PTRMASK (#201450)

This instruction is generated by the
[llvm.ptrmask](https://llvm.org/docs/LangRef.html#llvm-ptrmask-intrinsic)
intrinsic, which is used for Clang builtins like
[__builtin_align_up](https://clang.llvm.org/docs/LanguageExtensions.html#alignment-builtins)
which is used in `libc`.

We are working on building `libc` for SPIR-V, so we hit this problem.

Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply at anthropic.com>

---------

Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
Co-authored-by: Claude Sonnet 4.5 <noreply at anthropic.com>


  Commit: f4ecab143affd2c2c7953f58802673152fbd8c4b
      https://github.com/llvm/llvm-project/commit/f4ecab143affd2c2c7953f58802673152fbd8c4b
  Author: Justin Lebar <justin.lebar at gmail.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/test/CodeGen/AArch64/ldexp.ll
    A llvm/test/CodeGen/AArch64/powi-ldexp-promote-libcall-error.ll

  Log Message:
  -----------
  [SelectionDAG] Promote FPOWI/FLDEXP exponents where possible, and raise an error otherwise (#200621)

PromoteIntOp_ExpOp is reached when the exponent type is illegal.

- When the exponent type was smaller than int, we'd hit an assertion. In
builds where asserts were disabled, we actually ended up doing the right
thing; makeLibCall would sign-extend the value to int.

- When the exponent type was too large, we'd also hit an assertion. In
builds were asserts were disabled, we would *not* do the right thing;
we'd end up silently truncating the value. Now we explicitly raise an
error.


  Commit: 02cd239f7d3d9261af719b38f1afc18c0e9ea6f2
      https://github.com/llvm/llvm-project/commit/02cd239f7d3d9261af719b38f1afc18c0e9ea6f2
  Author: Petar Avramovic <Petar.Avramovic at amd.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.f16.fp8.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.fp8.f16.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pk.f16.ll

  Log Message:
  -----------
  AMDGPU/GlobalISel: RegBankLegalize rules for cvt f16<->fp8/bf8 (#202361)

Small types are impemented using integers in LLVMIR,
because of this there are no irtranslator failures.


  Commit: 00578ce75eaab675fc78fb4b78e1420dd9a63e60
      https://github.com/llvm/llvm-project/commit/00578ce75eaab675fc78fb4b78e1420dd9a63e60
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/docs/ReleaseNotes.rst
    R lld/test/MachO/lc-linker-option-order.ll
    A lld/test/MachO/lc-linker-option-postprocess.ll
    A lld/test/MachO/lc-linker-option-sort.ll
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
    M llvm/test/CodeGen/AArch64/ldexp.ll
    A llvm/test/CodeGen/AArch64/powi-ldexp-promote-libcall-error.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.f16.fp8.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.fp8.f16.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pk.f16.ll
    A llvm/test/CodeGen/SPIRV/ptrmask-logical.ll
    A llvm/test/CodeGen/SPIRV/ptrmask-vec.ll
    A llvm/test/CodeGen/SPIRV/ptrmask32.ll
    A llvm/test/CodeGen/SPIRV/ptrmask64-32.ll
    A llvm/test/CodeGen/SPIRV/ptrmask64.ll

  Log Message:
  -----------
  rebase

Created using spr 1.3.7


Compare: https://github.com/llvm/llvm-project/compare/8a8fc9ca733d...00578ce75eaa

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