[all-commits] [llvm/llvm-project] 173c08: [lld][LoongArch] Prevent relaxation oscillation fo...

hev via All-commits all-commits at lists.llvm.org
Sat Sep 26 08:45:57 PDT 2026


  Branch: refs/heads/users/hev/issue-226712
  Home:   https://github.com/llvm/llvm-project
  Commit: 173c08caa1df0b756f35cd8b6ed7539f44c64d2e
      https://github.com/llvm/llvm-project/commit/173c08caa1df0b756f35cd8b6ed7539f44c64d2e
  Author: WANG Rui <wangrui at loongson.cn>
  Date:   2026-09-26 (Sat, 26 Sep 2026)

  Changed paths:
    M lld/ELF/Arch/LoongArch.cpp

  Log Message:
  -----------
  [lld][LoongArch] Prevent relaxation oscillation for PCHi20 and CALL

Relaxation of pcalau12i+addi (relaxPCHi20Lo12, isInt<22>) and
call36/call30 (relaxMediumCall, isInt<28>) can oscillate: shrinking
one section moves a symbol, which flips isInt<N> for other sites and
changes bytesDropped again.  In large programs (e.g. Rust) the PC of
a site can stabilize while Dest jitter near the range limit, so
remove keeps alternating between 0 and 4 and relaxOnce never settles.

Follow the same approach as RISCV::relaxCall: after a few passes, do
not allow remove to increase beyond the previous pass's value
(cur - delta).  Pass that cap as prevRemove into the two helpers;
range checks may still clear remove (0) when the target goes out of
range.

No reduced in-tree stress test: the failure is layout- and
input-order-sensitive and was validated against a fixed response-file
reproduction in the bug issue.



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