[PATCH] AArch64: Optimize ADD relocations that resolve to zero

Project / Subsystem

binutils / aarch64

Date

2026-07-24

Proposer

Sivan Shani <sivan.shani@arm.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Replacing ADD with MOV/NOP can reduce instruction count and potentially improve performance by utilizing simpler instructions or reducing pipeline stalls.
  • Ensuring the optimization is applied correctly according to the ELF specification and handles all edge cases (e.g., SP register usage, 32-bit vs 64-bit modes).

All attributes

project
binutils
subsystem
aarch64
patch_id
discussion_id
20260724095859.909158-1-sivan.shani@arm.com
source_type
public_inbox
title
[PATCH] AArch64: Optimize ADD relocations that resolve to zero
headline
AArch64: Optimize ADD relocations that resolve to zero
tldr
Implements an optimization for AArch64 ADD instructions that can be replaced by MOV or NOP.
proposer
Sivan Shani <sivan.shani@arm.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Replacing ADD with MOV/NOP can reduce instruction count and potentially improve performance by utilizing simpler instructions or reducing pipeline stalls.
  • Ensuring the optimization is applied correctly according to the ELF specification and handles all edge cases (e.g., SP register usage, 32-bit vs 64-bit modes).
series_id
series_role
standalone
series_parts
[]
tags
  • aarch64
  • optimization
  • linker
  • performance
bugzilla_url
date
2026-07-24T00:00:00.000Z

[PATCH] AArch64: Optimize ADD relocations that resolve to zero

Sivan Shani proposes an optimization for the AArch64 architecture in binutils, following the ‘ELF for the Arm 64-bit Architecture’ specification. The patch optimizes ADD instructions where the immediate value becomes zero after relocation, replacing them with MOV or NOP instructions for efficiency. The changes include updates to BFD and the ld testsuite.