summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSean Eveson <eveson.sean@gmail.com>2017-11-30 13:05:14 +0000
committerSean Eveson <eveson.sean@gmail.com>2017-11-30 13:05:14 +0000
commitab494c93854b8593bc4c6a9212e4bd1ea826e8ae (patch)
tree85ae45ec94ecfaf3e86315c2d6122e3eb00f0aba /docs
parent360f53a441902d19ce27d070ad028005bc323e61 (diff)
[MC] Function stack size section.
Re applying after fixing issues in the diff, sorry for any painful conflicts/merges! Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128). The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary. There is a follow up change to add an option to clang. Thanks. Reviewers: hfinkel, MatzeB Reviewed By: MatzeB Subscribers: thegameg, asb, llvm-commits Differential Revision: https://reviews.llvm.org/D39788 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/CodeGenerator.rst11
-rw-r--r--docs/CommandGuide/llc.rst8
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/CodeGenerator.rst b/docs/CodeGenerator.rst
index bcdc7228356..5c0fb064959 100644
--- a/docs/CodeGenerator.rst
+++ b/docs/CodeGenerator.rst
@@ -1578,6 +1578,17 @@ which lowers MCInst's into machine code bytes and relocations. This is
important if you want to support direct .o file emission, or would like to
implement an assembler for your target.
+Emitting function stack size information
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A section containing metadata on function stack sizes will be emitted when
+``TargetLoweringObjectFile::StackSizesSection`` is not null, and
+``TargetOptions::EmitStackSizeSection`` is set (-stack-size-section). The
+section will contain an array of pairs of function symbol references (8 byte)
+and stack sizes (unsigned LEB128). The stack size values only include the space
+allocated in the function prologue. Functions with dynamic stack allocations are
+not included.
+
VLIW Packetizer
---------------
diff --git a/docs/CommandGuide/llc.rst b/docs/CommandGuide/llc.rst
index 5094259f9f9..95945e68d13 100644
--- a/docs/CommandGuide/llc.rst
+++ b/docs/CommandGuide/llc.rst
@@ -132,6 +132,14 @@ End-user Options
Specify which EABI version should conform to. Valid EABI versions are *gnu*,
*4* and *5*. Default value (*default*) depends on the triple.
+.. option:: -stack-size-section
+
+ Emit the .stack_sizes section which contains stack size metadata. The section
+ contains an array of pairs of function symbol references (8 byte) and stack
+ sizes (unsigned LEB128). The stack size values only include the space allocated
+ in the function prologue. Functions with dynamic stack allocations are not
+ included.
+
Tuning/Configuration Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~