OSDN Git Service

Subzero: Add rudimentary statistics on generated code.
authorJim Stichnoth <stichnot@chromium.org>
Wed, 17 Sep 2014 02:59:35 +0000 (19:59 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Wed, 17 Sep 2014 02:59:35 +0000 (19:59 -0700)
commit1873560a5b49434905d52460532c7fcce9b7e6de
tree10fbfa0509d8b0cfd6e698be676802c229d31615
parentbc004630f011e69deeca08428e59e15a4a602c1e
Subzero: Add rudimentary statistics on generated code.

The following are collected:
- Number of machine instructions emitted
- Number of registers saved/restored in prolog/epilog
- Number of stack frame bytes (non-alloca) allocated
- Number of "spills", or stores to stack slots
- Number of "fills", or loads/operations from stack slots
- Fill+Spill count (sum of above two)

These are somewhat reasonable approximations of code quality, and the primary intention is to compare before-and-after when trying out an optimization.

The statistics are dumped after translating each function.  Per-function and cumulative statistics are collected.  The output lines have a prefix that is easy to filter.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/580633002
src/IceCfgNode.cpp
src/IceClFlags.h
src/IceGlobalContext.cpp
src/IceGlobalContext.h
src/IceInst.h
src/IceInstX8632.h
src/IceTargetLoweringX8632.cpp
src/IceTranslator.cpp
src/llvm2ice.cpp