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.
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 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.
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