Hello all!

As many of you have realized over the last 2-3 days, all the code you have written seems to not be doing anything at all. Well, we screwed up :( c2dil has many optimizations, called from many places repeatedly, and as it turned out, the tasks in both 1A and 1B were being performed by other optimization passes. The good news is, we have finally hunted everything down, and now what you do should be reflected in the output. So, please cvs update and recompile c2dil.


1A: Improved CCP:
A clean example where you can see this at work is ccp_example2. If you run it through the compiler as is, you can see that y is being generated by adding 5 to x. Once you have implemented your improvement to CCP, you should be able to see y being set directly to 15.

To run the testcase: in the file Sample/2/MakeProg, set the SIMONEFUNC variable to ccp_example2

1B: ADCE:
Many of you have also realized that there are many possible implementations of ADCE, and you can be increasingly aggressive in what can be gotten rid of. For this assignment, we will be satisfied if you can get rid of the i variable in the adce_example() function. Without ADCE, you will see the i variable being leftshifted by 1 in the output assembly. With ADCE, it should vanish. Of course, we will be more than happy (and give you extra credit) if you implement something that is still correct but more aggressive, and show us a test case of your optimization at work.


To see the effect of your code:
You can try eyeballing the assembly to see the difference. Or, run dotty on the 2-preschedasm.dot file

To run dotty:
If you are on a linux machine, do the following:

	$ xhost +blackmamba.crcl.cs.cmu.edu (or habu)
	$ export DISPLAY=:0
	$ dotty 2-preschedasm.dot &

If you are on a Windows machine, start up an X-server, and set the "Allow X11 forwarding" flag when ssh-ing to blackmamba/habu.

dotty is a little broken in that it shows the invtriangles (i.e., etas) as rectangles. To see real invtriangles, you can do this:

	dot -Tps foo.dot > foo.ps

and then look at the ps.


STRONG recommendation:
At the top of your modifications in the CCP code, put in this:

	if (OPTION("noetaccp"))
		break;

At the top of your modifications in the ADCE code, put in this:

	if (OPTION("noadce"))
       		return false;

Then, in MakeProg, you can turn your modifications off by adding the noetaccp and noadce options. So, to turn your ccp changes off, change the C2DILOPTIONS line to:

C2DILOPTIONS =  -nosimul -schedasm -option noglobalbypass,nopipeline,noschedule,nopromotion,basic_blocks,noetaccp -dot

similarly, to turn off adce:

C2DILOPTIONS =  -nosimul -schedasm -option noglobalbypass,nopipeline,noschedule,nopromotion,basic_blocks,noadce -dot

Resolving CVS conflicts:
You might start seeing some CVS conflicts at this point, especially if you have made modifications to the files in Sample/2/ (when you cvs update, you will see CVS warning messages if this was the case). If you don't know what to do with these, send us email (though really, 5 minutes on google will tell you the 1 minute of work you need to do to fix this).
Let us know if there are any problems. And once again, sorry for all the pain and confusion.