[PATCH] D125036: [LLD][RISCV] Alignment relaxation

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 12:53:43 PDT 2022


gkm created this revision.
gkm added reviewers: ruiu, MaskRay, jrtc27, luismarques, reames.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, mgrang, edward-jones, zzheng, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, arichardson, emaste.
Herald added a project: All.
gkm requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD.
Herald added a project: LLVM.

This is the first in a stack of diffs that repackages and revises D100835 <https://reviews.llvm.org/D100835> for RISC-V linker relaxation.

This diff implements machinery to elide unwanted instruction bytes, and to rewrite NOP sequences that are optimal for code alignment padding.

Caveat: this has not been tested with options `--emit-relocs` or `--relocatable`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125036

Files:
  lld/ELF/Arch/RISCV.cpp
  lld/ELF/InputSection.cpp
  lld/ELF/InputSection.h
  lld/ELF/Relocations.cpp
  lld/ELF/Relocations.h
  lld/ELF/Target.h
  lld/ELF/Writer.cpp
  lld/test/ELF/riscv-relax-align-rvc.s
  lld/test/ELF/riscv-relax-align.s
  lld/test/ELF/riscv-reloc-align.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125036.427420.patch
Type: text/x-patch
Size: 14593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220505/c0941849/attachment.bin>


More information about the llvm-commits mailing list