[PATCH] D63306: Add a remarks-based code size diffing tool

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 16:25:54 PDT 2019


paquette created this revision.
paquette added reviewers: thegameg, anemet, fhahn, JDevlieghere.
Herald added subscribers: kristof.beyls, javed.absar, mgorny.
Herald added a project: LLVM.

This is a little remarks-based size diffing tool I hacked out using the new remarks section stuff. The idea here is to provide insight into function size changes that show up due to compiler changes rather than source code changes.

What this tool does is diffs the instruction counts produced by the asm-printer's remarks. This allows you to quickly see which functions changed in size between two compiles of the same program.

This is just the basic functionality for now.

I can imagine adding, say...

- Detailed information using size-info remarks
- Information from other pass' remarks, e.g the inliner (with remarks, we can directly access this information!)
- Some nice statistical output (e.g. foo contains 25% of the instructions in the program)

Some detailed output for reference:

https://hastebin.com/hucexocuxi.md

Detailed output shows the differences in instruction counts between compiling stepanov_vector for AArch64 at -Os and -O3 with Clang. (-Os count is first, -O3 count is second, delta is third.)


https://reviews.llvm.org/D63306

Files:
  llvm/test/tools/sizediff/Inputs/basic-a.opt.yaml
  llvm/test/tools/sizediff/Inputs/basic-b.opt.yaml
  llvm/test/tools/sizediff/basic-input.s
  llvm/test/tools/sizediff/no-remarks.s
  llvm/tools/sizediff/CMakeLists.txt
  llvm/tools/sizediff/LLVMBuild.txt
  llvm/tools/sizediff/sizediff.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63306.204651.patch
Type: text/x-patch
Size: 13934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190613/9e2d3208/attachment.bin>


More information about the llvm-commits mailing list