[PATCH] D34340: [XRay] Reduce synthetic references emitted by XRay

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 00:06:25 PDT 2017


dberris created this revision.
Herald added a subscriber: javed.absar.

When we're building with XRay instrumentation, we use a trick that
preserves references from the function to a function sled index. This
index table lives in a separate section, and without this trick the
linker is free to garbage-collect this section and all the segments it
refers to. Until we're able to tell the linkers to preserve these
sections, we use this reference trick to keep around both the index and
the entries in the instrumentation map.

Before this change we emitted both a synthetic reference to the label in
the instrumentation map, and to the entry in the function map index.
This change removes the first synthetic reference and only emits one
synthetic reference to the index -- the index entry has the references
to the labels in the instrumentation map, so the linker will still
preserve those if the function itself is preserved.

This reduces the amount of synthetic references we emit from 16 bytes to
just 8 bytes in x86_64, and similarly to other platforms.


https://reviews.llvm.org/D34340

Files:
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  test/CodeGen/AArch64/xray-attribute-instrumentation.ll
  test/CodeGen/AArch64/xray-tail-call-sled.ll
  test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll
  test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll
  test/CodeGen/X86/xray-attribute-instrumentation.ll
  test/CodeGen/X86/xray-custom-log.ll
  test/CodeGen/X86/xray-log-args.ll
  test/CodeGen/X86/xray-tail-call-sled.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34340.102991.patch
Type: text/x-patch
Size: 11381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170619/31a3fdf3/attachment.bin>


More information about the llvm-commits mailing list