[PATCH] D104080: [LLD][LLVM] CG Graph profile using relocations

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 17:17:23 PDT 2021


ayermolo created this revision.
Herald added subscribers: hoy, frasercrmck, wenlei, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, rupprecht, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, atanasyan, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, kbarton, hiraditya, arichardson, nemanjai, sdardis, emaste.
Herald added a reviewer: jhenderson.
Herald added a reviewer: MaskRay.
ayermolo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Re-implemented D103212 <https://reviews.llvm.org/D103212> using *_NONE relocation based on feedback from RFC. I changed ID of SHT_LLVM_CALL_GRAPH_PROFILE. Do we need to put SHT_LLVM_CALL_GRAPH_PROFILE_DEPRECATED for original ID? From feedback it seemed like it was not necessary.

Doing a quick experiment with clang-13.
The size went up from 107KB to 322KB, aggregate of all the input sections.

Looking at rel vs rela if I understand the llvm code correctly it's based on target so seems to apply to all the relocations.

Test Plan:
ninja check all, manual rtesting


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104080

Files:
  lld/ELF/Driver.cpp
  lld/ELF/InputFiles.cpp
  lld/ELF/InputFiles.h
  llvm/include/llvm/BinaryFormat/ELF.h
  llvm/include/llvm/MC/MCAsmBackend.h
  llvm/include/llvm/MC/MCELFStreamer.h
  llvm/include/llvm/Object/ELFTypes.h
  llvm/include/llvm/ObjectYAML/ELFYAML.h
  llvm/lib/MC/ELFObjectWriter.cpp
  llvm/lib/MC/MCELFStreamer.cpp
  llvm/lib/ObjectYAML/ELFEmitter.cpp
  llvm/lib/ObjectYAML/ELFYAML.cpp
  llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h
  llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
  llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h
  llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
  llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
  llvm/test/MC/ELF/cgprofile.s
  llvm/test/tools/llvm-readobj/ELF/call-graph-profile.test
  llvm/test/tools/llvm-readobj/ELF/demangle.test
  llvm/test/tools/obj2yaml/ELF/call-graph-profile-section.yaml
  llvm/test/tools/yaml2obj/ELF/call-graph-profile-section.yaml
  llvm/test/tools/yaml2obj/ELF/section-headers-exclude.yaml
  llvm/tools/llvm-readobj/ELFDumper.cpp
  llvm/tools/obj2yaml/elf2yaml.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104080.351312.patch
Type: text/x-patch
Size: 56634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/e429174b/attachment-0001.bin>


More information about the llvm-commits mailing list