aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-07-30 18:38:03 -0700
committerFangrui Song <i@maskray.me>2024-07-30 18:38:03 -0700
commitbe5a845e4c29aadb513ae6e5e2879dccf37efdbb (patch)
treea659acb325979bf401148e97e606b2f87fbff24a /llvm/tools/llvm-objdump/llvm-objdump.cpp
parentc35c4c72e4977258fc1da940e0470e8d0671bf07 (diff)
downloadllvm-be5a845e4c29aadb513ae6e5e2879dccf37efdbb.zip
llvm-be5a845e4c29aadb513ae6e5e2879dccf37efdbb.tar.gz
llvm-be5a845e4c29aadb513ae6e5e2879dccf37efdbb.tar.bz2
[MC] Compute fragment offsets eagerly
This builds on top of commit 9d0754ada5dbbc0c009bcc2f7824488419cc5530 ("[MC] Relax fragments eagerly") and relaxes fragments eagerly to eliminate MCSection::HasLayout and `getFragmentOffset` overhead. The approach is slightly different from 1a47f3f3db66589c11f8ddacfeaecc03fb80c510 and has less performance benefit. The new layout algorithm also addresses the following problems: * Size change of MCFillFragment/MCOrgFragment did not influence the fixed-point iteration, which could be problematic for contrived cases. * The `invalid number of bytes` error was reported too early. Since `.zero A-B` might have temporary negative values in the first few iterations. * X86AsmBackend::finishLayout performed only one iteration, which might not converge. In addition, the removed `#ifndef NDEBUG` code (disabled by default) in X86AsmBackend::finishLayout was problematic, as !NDEBUG and NDEBUG builds evaluated fragment offsets at different times before this patch. * The computed layout for relax-recompute-align.s is optimal now. Builds with many text sections (e.g. full LTO) shall observe a decrease in compile time while the new algorithm could be slightly slower for some -O0 -g projects. Aligned bundling from the deprecated PNaCl placed constraints how we can perform iteration.
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions