[PATCH] D61584: [DebugInfo] Some fields do not need relocations even relax is enabled.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 14:12:45 PDT 2023


MaskRay added subscribers: reames, compnerd.
MaskRay added a comment.
Herald added subscribers: luke, pcwang-thead, frasercrmck, luismarques, sameer.abuasal, s.egerton, Jim.
Herald added a project: All.

@reames

This piece of code (including `canFold`) was removed by @compnerd's linker relaxation refactoring D103539 <https://reviews.llvm.org/D103539> (`RISCV: adjust handling of relocation emission for RISCV`)

For `MCObjectStreamer::emitDwarfAdvanceLineAddr` and `MCObjectStreamer::emitDwarfAdvanceFrameAddr`, I think we really just want to get rid of the "fast path" for assembling (commit 57ab708bdd3231b23a8ef4978b11ff07616034a2 (2010)): D150004 <https://reviews.llvm.org/D150004>.

With this `canFold` code in place, the fast path and the slow path (a relaxable fragment) have diverging behaviors for RISC-V.
The slow path tends to be tested more and more robust, since it controls direct object code emission (more likely noticed by debuggers, etc), while the fast path is only for assembly output (assembly input files are less common & `clang -S a.c; clang -c a.s` users are uncommon).

I have tried reading MCExpr.cpp multiple times and I always feel that some parts of it need more love to address some problems (some are documented as FIXME).

(If the fast path is for simple operations like LEB128 (see D150004 <https://reviews.llvm.org/D150004>'s analysis), I will more likely accept.
However, I'd prefer that we pay more attention to make the "slow path" faster.)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61584/new/

https://reviews.llvm.org/D61584



More information about the llvm-commits mailing list