CMU 15-745 Spring 2007, Assignment 1

 
This assignment has two parts:

1A: Improving CCP

Starting with our CCP pass, extend it to exploit information from the comparisons that control the etas. Your modifications should be limited to ssaopt.cc.

The main point of this part of the assignment is to get familiar with CASH and the data structures used to manipulate and traverse pegasus.

Your goal is to improve the ccp pass by understanding the effect of predicate evaluation on the kinds of values that can be passed by an eta node. In the following small C snippet and its assoiciated pegasus graph we can see an example of how we can improve the ccp pass.

Since we know that the only value of x that can be passed from the pink basic block to the blue basic block is 10, we can use that information to show that y, in the blue basic block, is 15 at output.

The approach you should take is to modify what happens for the op_eta arm of the main switch in Procedure:ccp().

1B: Implementing Aggresive Dead Code Elimination

Implement aggressive dead code elimination. Rather than starting with the assumption that all nodes are live, start with the assumption that all are dead, then mark them live iteratively. Your modifications should be limited to ssaopt.cc.

coding hint: to remove nodes permanently, use this code:

        ForAll(DeadIterator) {
              Operation* op = DeadIterator();
              op->getParent()->remove_dead_node(op);
        }
(although another way to do it might be to just disconnect their outputs, and then let regular DCE remove them.)

1B alternative

Change CCP to conditional range analysis. See us first if you choose this though to avoid taking on too big a project. Your modifications should be limited to ssaopt.cc.
To get the test case, do an update in Sample/2/.
Information on Pegasus internals is available through the
Useful Info link. Also, there is a new reference paper for Pegasus/CASH on the Schedule page.

 

ALGORITHM HINTS

Top General Info Schedule Projects Assignments Papers Useful Info