report - A simple reporter for the Simple SUIF instruction set Overview report generates some simple reports about Simple SUIF programs. Definitions This report identifies all definitions of a pseudo-register in a procedure. The statistics for each pseudo-register are reported separately, along with the line number(s) at which the definition occurs and the name and type of the corresponding variable. SUIF temporary registers are ignored. However, SUIF may generate its own temporary variables in some instances, and these variables can be assigned SUIF pseudo-registers which may be targets for optimization. Note that the initial definition of a parameter, i.e., the definition that occurs in the calling procedure, does not appear in the Simple SUIF source that is processed. Therefore, the report program will most likely report a use of a parameter occuring at a line before any definition of the parameter. Uses This report identifies all uses of a pseudo-register in a procedure. The statistics for each pseudo-register are reported separately, along with the line number(s) at which the definition occurs and the name and type of the corresponding variable. SUIF temporary registers are ignored. However, SUIF may generate its own temporary variables in some instances, and these variables can be assigned SUIF pseudo-registers which may be targets for optimization. Note that the initial definition of a parameter, i.e., the definition that occurs in the calling procedure, does not appear in the Simple SUIF source that is processed. Therefore, the report program will most likely report a use of a parameter occuring at a line before any definition of the parameter. Usage Usage: ./report suif-file [options] -ra report on definitions -ru report on uses The reports can not be generated simultaneously. The text of the reports is printed to standard error. Program Structure The code for the analyses is contained in the files * report_stats.cc * report_stats.h Calls to the two procedures: * report_assignment(simple_instr*, char*) * report_uses(simple_instr*, char*) are inserted into the body of do_procedure(simple_instr*, char*). The procedures return immediately unless the appropriate flags are passed to the report executable. All the procedures that print out a report take the output stream as their first parameter. Therefore, it is possible to modify the code in report_stats.cc so that it prints to an output stream other than standard error by modifying the report_assignment(simple_instr*, char*) and report_uses(simple_instr*, char*) procedures so that they pass the appropriate FILE* objects to the report method. Obtaining the Source The source is available at /p/course/cs701-fischer/public/suif/CODEGEN_REPORT. Remarks The report program is not guaranteed to be correct. Any corrections are welcome, as well as any suggestions for ways to make the program more useful. mulhern (mulhern@cs.wisc.edu)