bbcount user manual
|Title||bbcount (Basic block counter annotation pass for Machine-SUIF)|
|Author||Nikolaos Kavvadias 2004, 2005, 2006, 2007, 2008, 2009 2010, 2011, 2012, 2013, 2014, 2015, 2016|
|Release Date||02 October 2014|
bbcount is an annotation pass built to be used with the SUIF2/MachSUIF2
compiler infrastructure. This pass creates a basic block annotation (BbNote)
that is attached to the first machine instruction of basic block. BbNote
information can then be exported to text files for diagnostic and other uses.
A BbNote can then be read by subsequent passes.
The BbNote class extends Machine-SUIF class Note and provides the following methods:
int get_idnum() const
Returns the first member of the note (procedure/CFG identification number).
void set_idnum(int idnum)
Sets the first member of the note to
IdString get_bb_counter() const
Returns the basic block counter (second member) as a string.
void set_bb_counter(IdString idbb).
Sets the basic block counter to the
idbb string contents.
This pass uses the machine and cfg libraries. What it actually generates are the
the values of BbNote annotations in a text file (
bb_counters.txt). The format
of this file is shown below:
cnt_exec_freq.<proc_count>.<bb_num> ;; once for each basic block ... ... <proc_name> <proc_count> <bb_num-1> ;; once at the end of a CFG
- is the string representation of the procedure's name
- the absolute enumeration of the procedure in the translation unit
- the absolute enumeration of the basic block in the given CFG/procedure.
This pass works for the SUIFvm instruction set as well as other MachSUIF
bbcount pass has been tested with MachSUIF 2.02.07.15.
2. File listing
bbcount distribution includes the following files:
|LICENSE||The modified BSD license governs
|README.html||HTML version of README.|
|README.pdf||PDF version of README.|
|VERSION||Current version of the project sources.|
|bbcount.cpp||Implementation of the
|bbcount.h||C++ header file containing declarations and prototypes for the above.|
|rst2docs.sh||Bash script for generating the HTML and PDF versions of the documentation (README).|
|suif_main.cpp||Entry point for building the standalone program
|suif_pass.cpp||Define the SUIF pass built as the dynamically
|suif_main.h||C++ header file for the above.|
|utils.h||C header file with implementations of auxiliary functions.|
bbcount archive wherever you like, e.g. in
You don't need to modify anything in the Makefile, if you have a working
MachSUIF 2 installation.
The program binary (
do_bbcount) will be installed at
the shared library (
$NCIHOME/solib, where NCIHOME is
the SUIF 2 top-level directory.
4. Usage details
The pass accepts an input file in CFG form to operate. Textual output is generated, written to stdout by default.
$ do_bbcount test.cfg