Patch to use new loop_depth info

Jeffrey A Law law@cygnus.com
Fri Dec 31 16:38:00 GMT 1999


  In message < 19991203003300.53837@atrey.karlin.mff.cuni.cz >you write:
  > Hi
  > This patch does the trick of using loop_depth calculated using new loop
  > infrastructure.  Because calculate_loop_depth looks more costy now (it isn'
  > t on
  > average code) I've decided to split it out of find_basic_block and make it 
  > as
  > new entry point, so it is done only once per function now in flow pass.
  > 
  > Also it makes the dump of the new loop infrastructure into flow dump.
  > 
  > Fri Dec  2 18:15:27 CET 1999  Jan Hubicka  <hubicka@freesoft.cz>
  > 	* final.c (calculate_loop_depth): Make global, remove prototype,
  > 	rewrite to use new loop infrastructure.
  > 	(find_basic_block): Remove calculate_loop_depth call.
  > 	* toplev.c (rest_of_compilation): Call find_basic_block.
  > 	* output.h (calculate_loop_depth): Declare.
First, try to be more careful with your ChangeLogs.  The file you changed
was "flow.c", not "final.c".  Slow down and take a deep breath; this is not
a race to produce as much code as possible.  Better to wait a day if you're
up late and tired than try to hurry a patch out the door.

[ Note the same advice applies to me and everyone else. ]

Your indention of the parameter FILE *dump; is incorrect in the definition of
calculate_loop_depth.  Parameters are indented exactly 5 spaces.  No more,
no less.

You should also note in the comment before calculate_loop_depth that it
relies on the CFG and thus it can only be called after find_basic_blocks
has built the CFG.

Fix up those minor problems and you can install this patch.  Thanks.

FWIW, on average code, I would expect the new loop detection code to be slower
than the current code which scans the insns looping for notes.  In particular,
the code to compute dominator information is rather expensive.  There
are faster algorithms to compute dominators and one day we will probably
have to use them as we rely more and more on computing dominators.

jeff




More information about the Gcc-patches mailing list