CS 5363: Compiler Project, Extra Credit #1
Submission Deadline: 5pm, November 1, 2005
First Extra Credit Assignment
Extra credit can be earned by adding some or all of the following
machine-independent optimizations to your compiler:
- dead-code elimination
- Add a pass to your compiler that detects and removes
instructions that are useless or unreachable using the algorithm
in Section 10.3.1 of your text book. It is not necessary
to implement the removal of useless control flow. If you do
implement the removal of useless control flow, then you may
need to update φ-functions to maintain the proper relation
between φ-function operands and the CFG. If you do not
implement the removal of useless control flow, you will need
to treat branch instructions as "critical".
- redundancy elimination
- Add a pass to your compiler that detects redundant expressions
using the domination-based value numbering algorithm described in
Section 8.5.2 of your text book. Pseudocode for this algorithm
can be found in Figure 4 of
Briggs, Cooper, and Simpson's paper on Value Number.
- constant propagation
- Add a pass to your compiler that uses the sparse simple
constant propagation algorithm found in Section 10.3.3 of your
text book.
Include a mechanism (e.g., a command-line switch) for disabling/enabling
individual optimization passes, and a mechanism for outputting the CFG
before and after optimization.
Deliverables and Submission
You may include these optimizations in your final submission for part #3.
Please, include the following additional information in the
cover letter for that assignment:
- which optimizations you implemented
- how to activate/deactivate them in your compiler
- the order of your optimization passes and rationale for choosing
that order
Also make sure that your included test cases demonstrate and test
your optimizations.
Grading Criteria
You may implement some or all of the 3 optimizations listed above.
Each of which, will earn you extra credit worth up to 5% of the
total class grade. Be sure to include a mechanism to view both the
optimized and unoptimized IR.
As a matter of policy, late work will not be accepted.
Errata
There may need to be corrections, clarifications, or other modifications
to these instructions, you are responsible for monitoring the class web
site, monitoring your CS account mailboxes, and listening during lecture
for announcements related to this assignment.
- 10/26/2005: Added a link to Briggs, Cooper, and Simpson's Value
Numbering paper.