This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: loop_has_multiple_exits ?


  In message <14119.64901.584949.98771@ongaonga.elec.canterbury.ac.nz>you write
:
  > 
  > prescan_loop sets the variable loop_has_multiple_exits if the next
  > non-note insn at the end of the loop is not a CODE_LABEL.
  > Can anyone suggest why this test is needed?
  > 
  > Many well behaved loops we generate with a single exit never have this
  > label, for example, an unjumped for-loop with a constant number of
  > iterations.
  > 
  > I applied the following patch to remove this test and bootstrapped OK
  > an i686-pc-gnu-linux with and without -funroll-loops.
  > 
  > Michael.
  > 
  > 
  > 
  > Thu Apr 29 18:33:11 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
  > 
  > 	* loop.c (prescan_loop): Don't set loop_has_multiple_exit_targets
  > 	for loops that don't have a following CODE_LABEL.
Rather than keep hacking on what I consider some of the lamest code in the
compiler, let's solve this problem and take a step forward at the same
time.

Specifically, let's use the cfg code to figure this stuff out.  The algorithms
to find loops, loop exits, etc etc are well known and even implemented if you
look around in haifa-sched.c.

We've known for a long time that much of loop.c needs to be rewritten based
on modern alogirthms to analyze loops.  Let's get started.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]