[lld] ELF: Add branch-to-branch optimization. (PR #138366)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 22:19:34 PDT 2025


================
@@ -93,6 +93,10 @@ Bind default visibility defined STB_GLOBAL function symbols locally for
 .Fl shared.
 .It Fl -be8
 Write a Big Endian ELF File using BE8 format(AArch32 only)
+.It Fl -branch-to-branch
+Enable the branch-to-branch optimizations: a branch whose target is
+another branch instruction is rewritten to point to the latter branch
+target (AArch64 and X86_64 only). Enabled by default at -O2.
----------------
MaskRay wrote:

-O2 should use `.Fl O2.` (unfortunately the dot after `-O2` has to be highlighted as well...)

https://github.com/llvm/llvm-project/pull/138366


More information about the llvm-commits mailing list