[llvm-branch-commits] [lld] ELF: CFI jump table relaxation. (PR #147424)
Peter Collingbourne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat May 2 19:31:38 PDT 2026
================
@@ -312,6 +313,196 @@ bool X86_64::deleteFallThruJmpInsn(InputSection &is,
return true;
}
+void X86_64::relaxCFIJumpTables() const {
+ // Relax CFI jump tables.
+ // - Split jump table into pieces and place target functions inside the jump
+ // table if small enough.
+ // - Move jump table before last called function and delete last branch
+ // instruction.
+ DenseMap<InputSection *, SmallVector<InputSection *, 0>> sectionReplacements;
+ SmallVector<InputSection *, 0> storage;
+ for (OutputSection *osec : ctx.outputSections) {
----------------
pcc wrote:
I think I profiled it at the time and it didn't make a measurable difference. But I'll take another look. We may want to tie this to -O like branch-to-branch.
https://github.com/llvm/llvm-project/pull/147424
More information about the llvm-branch-commits
mailing list