- /* kill dead code */
- kchange = killDeadCode (ebbs, saveCount);
-
- if (options.dump_kill)
- dumpEbbsToFileExt(".dumpdeadcode",ebbs,count);
-
- /* do loop optimizations */
- change += (lchange = loopOptimizations (loops,ebbs,count));
- if (options.dump_loop)
- dumpEbbsToFileExt(".dumploop",ebbs,count);
-
- /* recompute the data flow and apply global cse again
- if loops optimizations or dead code caused a change:
- loops will brings out of the loop which then may be
- available for use in the later blocks: dead code
- elimination could potentially disconnect some blocks
- conditional flow may be efected so we need to apply
- subexpression once more */
- if ( lchange || kchange ) {
-
- computeDataFlow (ebbs,saveCount);
- change += cseAllBlocks(ebbs,saveCount);
- if (options.dump_loop)
- dumpEbbsToFileExt(".dumploopg",ebbs,count);
-
- /* if loop optimizations caused a change then do
- dead code elimination once more : this will
- get rid of the extra assignments to the induction
- variables created during loop optimizations */
- killDeadCode (ebbs, saveCount);
-
- if (options.dump_loop)
- dumpEbbsToFileExt(".dumploopd",ebbs,count);
-
- }
-
-
- /* sort it back by block number */
- qsort (ebbs,saveCount,sizeof(eBBlock *),bbNumCompare);
-
- /* if cyclomatic info requested then print it */
- if (options.cyclomatic)
- printCyclomatic(ebbs,saveCount);
-
-
- /* convert operations with support routines
- written in C to function calls : Iam doing
- this at this point since I want all the
- operations to be as they are for optimzations */
- convertToFcall (ebbs,count);
-
- /* check if the parameters and local variables
- of this function can be put in the overlay segment
- This check is essentially to see if the function
- calls any other functions if yes then we cannot
- overlay */
- if (canOverlayLocals(ebbs,count))
- /* if we can then put the parameters &
- local variables in the overlay set */
- overlay2Set();
- else
- /* otherwise put them into data where
- they belong */
- overlay2data();
-
- /* compute the live ranges */
- computeLiveRanges (ebbs,count);
-
- if (options.dump_range)
- dumpEbbsToFileExt(".dumprange",ebbs,count);
-
- /* allocate registers & generate code */
- port->assignRegisters(ebbs,count);
-
- /* throw away blocks */
- setToNull ((void **)&graphEdges);
- ebbs = NULL ;
+ /* kill dead code */
+ kchange = killDeadCode (ebbs, saveCount);
+
+ if (options.dump_kill)
+ dumpEbbsToFileExt (DUMP_DEADCODE, ebbs, count);
+
+ /* do loop optimizations */
+ change += (lchange = loopOptimizations (loops, ebbs, count));
+ if (options.dump_loop)
+ dumpEbbsToFileExt (DUMP_LOOP, ebbs, count);
+
+ /* recompute the data flow and apply global cse again
+ if loops optimizations or dead code caused a change:
+ loops will brings out of the loop which then may be
+ available for use in the later blocks: dead code
+ elimination could potentially disconnect some blocks
+ conditional flow may be efected so we need to apply
+ subexpression once more */
+ if (lchange || kchange)
+ {
+ computeDataFlow (ebbs, saveCount);
+ change += cseAllBlocks (ebbs, saveCount);
+ if (options.dump_loop)
+ dumpEbbsToFileExt (DUMP_LOOPG, ebbs, count);
+
+ /* if loop optimizations caused a change then do
+ dead code elimination once more : this will
+ get rid of the extra assignments to the induction
+ variables created during loop optimizations */
+ killDeadCode (ebbs, saveCount);
+
+ if (options.dump_loop)
+ dumpEbbsToFileExt (DUMP_LOOPD, ebbs, count);