CS 701, Program #3 Extra Credit

CS 701, Program 3 Extra Credit
25 Extra-Credit Points

Moving Only Profitable Code

For 25 extra-credit points, modify your program so that, if flags.h contains #define PROFITABLE 1, you move only instructions that are profitable -- i.e., are guaranteed to execute once the loop body is entered. You should also move profitable, loop-invariant instructions with division and remainder opcodes (since those instructions would execute anyway, it isn't a problem if they cause runtime errors).

Please include a README file in your HANDIN directory that says that you implemented this extension to the project, as well as one file called test.c that demonstrates this work by moving a different set of loop-invariant instructions when PROFITABLE is defined.