Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This document contains the list commits made for the LTO dump tool project for GCC under GSOC 2018.

LTO Dump Tool Project

The purpose of this dump tool is to analyze the LTO object files.

Link to Repository

https://github.com/hrisearch/gcc/tree/lto-dump-tool-v4

Abstract

The LTO object file is a regular elf file with sections containing LTO byte-code. A LTO object file contains various sections for storing command line options, symbol table, global declarations and types, function bodies in GIMPLE, call graph, etc. There are couple of limitations of the byte code format: 1] It is not self descriptive, which makes it harder to debug. 2] The byte code is essentially a “serialized” version of in-memory representations, which makes it prone to break across versions. The purpose of this project is to create a dump tool for easily analyzing LTO object files similar to readelf or objdump -d for regular elf object files.

Command line options added in the dumping infrastructure are:

Command Line option Function
-list Dumps list of details of functions and variables.
-demangle Dump the demangled output.
-defined-only Dump only the defined symbols.
-print-value Dump initial values of the variables.
-name-sort Sort the symbols alphabetically.
-size-sort Sort the symbols according to size.
-reverse-sort Dump the symbols in reverse order.
-no-sort Dump the symbols in order of occurence.
-symbol= Dump the details of specific symbol.
-objects= Dump the details of LTO objects.
-type-stats Dump the statistics of tree types.
-tree-stats Dump the statistics of trees.
-gimple-stats Dump the statistics of gimple statements.
-dump-level= For deciding the optimization level of body.
-dump-body= Dump the specific gimple body.
-help Display the dump tool help.

Links to commits:

Created seperate LTO dump tool.
https://github.com/hrisearch/gcc/commit/df051fdffd46e3bbbe353a518313f6ca9fe28a16

Created command line option for dumping symbol list.
https://github.com/hrisearch/gcc/commit/6352526b215ea0d73ff5d2b2f61af48e7dd98054

Created command line option for dumping detail information of specified symbol.
https://github.com/hrisearch/gcc/commit/fb6e208cefa3a3c023461ea881d355b38e9f4fd3

Created command line option for dumping details of LTO objects.
https://github.com/hrisearch/gcc/commit/9f24b09033f411b81e4abac98cd5f2a774a9dfe2

Created command line option for dumping tree type statistics.
https://github.com/hrisearch/gcc/commit/8adf1a5a821d7e45935e6a04253ffce16914e70e

Created command line option for dumping GIMPLE and TREE statistics.
https://github.com/hrisearch/gcc/commit/afb385fc2249a9e89f8ac551dc812a8c5b922127

Added command line options to dump specific optimized body of specified function.
https://github.com/hrisearch/gcc/commit/0a03e68c13f0635db1e2c8e4e1621c8e7af5b7e8

Changes for refactoring.
https://github.com/hrisearch/gcc/commit/d181dd7e7a423cde7bf59e2af7531f50dfd646f0

Incorporated feedback part 1 and 2.
https://github.com/hrisearch/gcc/commit/ba8313116d93d1e7d22e4fe15b072f595f864088

Incorporated feedback part 3 and 4.
https://github.com/hrisearch/gcc/commit/2d95416af9bd870a3d10f4a4c0b0cf20afb074f0

lto_main comment added.
https://github.com/hrisearch/gcc/commit/667113ca5e9b8ed0989492dd352db75445be309f

Documentation and corrections.
https://github.com/hrisearch/gcc/commit/de0eb1f59c06facf482c07fcada5a985289d0151

Improvements in documentation.
https://github.com/hrisearch/gcc/commit/e80ee94c6bf12069316c15ad0f636382e133fdf3

Improvements in refactoring.
https://github.com/hrisearch/gcc/commit/f1399b0272a038061e014aa0f06e4a8064e84686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.