[PATCH] D38768: Add remarks describing when a pass changes the IR instruction count of a module
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 10 15:07:03 PDT 2017
paquette created this revision.
Herald added subscribers: fhahn, mehdi_amini.
This patch adds a remark which tells the user when a pass changes the number of IR instructions in a module. It can be enabled by using -Rpass-analysis=size-info. The point of this is to make it easier to collect statistics on how passes modify programs in terms of code size. This is similar in concept to timing reports, but using a remark-based interface makes it easy to diff changes over multiple compilations of the same program. By adding functionality like this, we can see
- Which passes impact code size the most
- How passes impact code size at different optimization levels
- Which pass might have contributed the most to an overall code size regression
The patch lives in the legacy pass manager, but since it's simply emitting remarks, it shouldn't be too difficult to adapt the functionality to the new pass manager as well. This can also be adapted to handle MachineInstr counts in the later Machine* passes.
https://reviews.llvm.org/D38768
Files:
include/llvm/IR/LegacyPassManagers.h
lib/Analysis/CGSCCPassManager.cpp
lib/Analysis/CallGraphSCCPass.cpp
lib/IR/LegacyPassManager.cpp
test/Other/size-remarks.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38768.118491.patch
Type: text/x-patch
Size: 14441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171010/c3113422/attachment.bin>
More information about the llvm-commits
mailing list