[lld-macho] Support folding of functions with identical LSDAs
authorJez Ng <jezng@fb.com>
Tue, 19 Jul 2022 17:18:54 +0000 (13:18 -0400)
committerJez Ng <jezng@fb.com>
Tue, 19 Jul 2022 17:29:52 +0000 (13:29 -0400)
commitf6017abb602780d81be928c93ec6afe74752f613
tree8ebbdbb43688e6c6e2a376cc7e35f8fa4fa41801
parent2d05418b17c73595b44f968f0cc5148550ad785e
[lld-macho] Support folding of functions with identical LSDAs

To do this, we need to slice away the LSDA pointer, just like we are
slicing away the functionAddress pointer.

No observable difference in perf on chromium_framework:

             base           diff           difference (95% CI)
  sys_time   1.769 ± 0.068  1.761 ± 0.065  [  -2.7% ..   +1.8%]
  user_time  9.517 ± 0.110  9.528 ± 0.116  [  -0.6% ..   +0.8%]
  wall_time  8.291 ± 0.174  8.307 ± 0.183  [  -1.1% ..   +1.5%]
  samples    21             25

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D129830
lld/MachO/ICF.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputSection.cpp
lld/MachO/InputSection.h
lld/test/MachO/icf.s