Commit 52b38064 by Michael Hayes Committed by Michael Hayes

loop.h (LOOP_INFO): New accessor macro.

2000-01-25  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>

	* loop.h (LOOP_INFO): New accessor macro.
	* basic-block.h (struct loop): Rename field `info' to `aux'.
	* loop.c (scan_loop): Replace loop->info with LOOP_INFO (loop).
	(prescan_loop, strength_reduce, check_dbra_loop, insert_bct): Likewise.
	* unroll.c (loop_iterations, unroll_loop): Likewise.

From-SVN: r31596
parent a1e3399a
2000-01-25 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.h (LOOP_INFO): New accessor macro.
* basic-block.h (struct loop): Rename field `info' to `aux'.
* loop.c (scan_loop): Replace loop->info with LOOP_INFO (loop).
(prescan_loop, strength_reduce, check_dbra_loop, insert_bct): Likewise.
* unroll.c (loop_iterations, unroll_loop): Likewise.
2000-01-24 Christopher Faylor <cgf@cygnus.com> 2000-01-24 Christopher Faylor <cgf@cygnus.com>
* config/i386/t-cygwin: Accomodate new winsup directory layout * config/i386/t-cygwin: Accomodate new winsup directory layout
......
...@@ -274,7 +274,7 @@ struct loop ...@@ -274,7 +274,7 @@ struct loop
int invalid; int invalid;
/* Auxiliary info specific to a pass. */ /* Auxiliary info specific to a pass. */
void *info; void *aux;
/* The following are currently used by loop.c but they are likely to /* The following are currently used by loop.c but they are likely to
disappear as loop.c is converted to use the CFG. */ disappear as loop.c is converted to use the CFG. */
......
...@@ -467,7 +467,7 @@ loop_optimize (f, dumpfile, unroll_p, bct_p) ...@@ -467,7 +467,7 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
/* Allocate and initialize auxiliary loop information. */ /* Allocate and initialize auxiliary loop information. */
loops_info = xcalloc (loops->num, sizeof (struct loop_info)); loops_info = xcalloc (loops->num, sizeof (struct loop_info));
for (i = 0; i < loops->num; i++) for (i = 0; i < loops->num; i++)
loops->array[i].info = loops_info + i; loops->array[i].aux = loops_info + i;
/* Now find all register lifetimes. This must be done after /* Now find all register lifetimes. This must be done after
find_and_verify_loops, because it might reorder the insns in the find_and_verify_loops, because it might reorder the insns in the
...@@ -590,7 +590,7 @@ scan_loop (loop, unroll_p, bct_p) ...@@ -590,7 +590,7 @@ scan_loop (loop, unroll_p, bct_p)
register int i; register int i;
rtx loop_start = loop->start; rtx loop_start = loop->start;
rtx loop_end = loop->end; rtx loop_end = loop->end;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
rtx p; rtx p;
/* 1 if we are scanning insns that could be executed zero times. */ /* 1 if we are scanning insns that could be executed zero times. */
int maybe_never = 0; int maybe_never = 0;
...@@ -2366,7 +2366,7 @@ constant_high_bytes (p, loop_start) ...@@ -2366,7 +2366,7 @@ constant_high_bytes (p, loop_start)
#endif #endif
/* Scan a loop setting the elements `cont', `vtop', `loops_enclosed', /* Scan a loop setting the elements `cont', `vtop', `loops_enclosed',
`has_call', `has_volatile', and `has_tablejump' within LOOP_INFO. `has_call', `has_volatile', and `has_tablejump' within LOOP.
Set the global variables `unknown_address_altered', Set the global variables `unknown_address_altered',
`unknown_constant_address_altered', and `num_mem_sets'. Also, fill `unknown_constant_address_altered', and `num_mem_sets'. Also, fill
in the array `loop_mems' and the list `loop_store_mems'. */ in the array `loop_mems' and the list `loop_store_mems'. */
...@@ -2377,7 +2377,7 @@ prescan_loop (loop) ...@@ -2377,7 +2377,7 @@ prescan_loop (loop)
{ {
register int level = 1; register int level = 1;
rtx insn; rtx insn;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
rtx start = loop->start; rtx start = loop->start;
rtx end = loop->end; rtx end = loop->end;
/* The label after END. Jumping here is just like falling off the /* The label after END. Jumping here is just like falling off the
...@@ -3716,7 +3716,7 @@ strength_reduce (loop, insn_count, unroll_p, bct_p) ...@@ -3716,7 +3716,7 @@ strength_reduce (loop, insn_count, unroll_p, bct_p)
int past_loop_latch = 0; int past_loop_latch = 0;
/* Temporary list pointers for traversing loop_iv_list. */ /* Temporary list pointers for traversing loop_iv_list. */
struct iv_class *bl, **backbl; struct iv_class *bl, **backbl;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
/* Ratio of extra register life span we can justify /* Ratio of extra register life span we can justify
for saving an instruction. More if loop doesn't call subroutines for saving an instruction. More if loop doesn't call subroutines
since in that case saving an insn makes more difference since in that case saving an insn makes more difference
...@@ -7854,7 +7854,7 @@ check_dbra_loop (loop, insn_count) ...@@ -7854,7 +7854,7 @@ check_dbra_loop (loop, insn_count)
int compare_and_branch; int compare_and_branch;
rtx loop_start = loop->start; rtx loop_start = loop->start;
rtx loop_end = loop->end; rtx loop_end = loop->end;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
/* If last insn is a conditional branch, and the insn before tests a /* If last insn is a conditional branch, and the insn before tests a
register value, try to optimize it. Otherwise, we can't do anything. */ register value, try to optimize it. Otherwise, we can't do anything. */
...@@ -9278,7 +9278,7 @@ insert_bct (loop) ...@@ -9278,7 +9278,7 @@ insert_bct (loop)
unsigned HOST_WIDE_INT n_iterations; unsigned HOST_WIDE_INT n_iterations;
rtx loop_start = loop->start; rtx loop_start = loop->start;
rtx loop_end = loop->end; rtx loop_end = loop->end;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
int loop_num = loop->num; int loop_num = loop->num;
#if 0 #if 0
...@@ -9374,7 +9374,7 @@ insert_bct (loop) ...@@ -9374,7 +9374,7 @@ insert_bct (loop)
/* Mark all enclosing loops that they cannot use count register. */ /* Mark all enclosing loops that they cannot use count register. */
for (outer_loop = loop; outer_loop; outer_loop = outer_loop->outer) for (outer_loop = loop; outer_loop; outer_loop = outer_loop->outer)
{ {
outer_loop_info = outer_loop->info; outer_loop_info = LOOP_INFO (outer_loop);
outer_loop_info->used_count_register = 1; outer_loop_info->used_count_register = 1;
} }
instrument_loop_bct (loop_start, loop_end, GEN_INT (n_iterations)); instrument_loop_bct (loop_start, loop_end, GEN_INT (n_iterations));
......
...@@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA. */
#include "varray.h" #include "varray.h"
#include "basic-block.h" #include "basic-block.h"
/* Get the loop info pointer of a loop. */
#define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux)
/* Get the luid of an insn. Catch the error of trying to reference the LUID /* Get the luid of an insn. Catch the error of trying to reference the LUID
of an insn added during loop, since these don't have LUIDs. */ of an insn added during loop, since these don't have LUIDs. */
......
...@@ -256,7 +256,7 @@ unroll_loop (loop, insn_count, end_insert_before, strength_reduce_p) ...@@ -256,7 +256,7 @@ unroll_loop (loop, insn_count, end_insert_before, strength_reduce_p)
rtx last_loop_insn; rtx last_loop_insn;
rtx loop_start = loop->start; rtx loop_start = loop->start;
rtx loop_end = loop->end; rtx loop_end = loop->end;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
/* Don't bother unrolling huge loops. Since the minimum factor is /* Don't bother unrolling huge loops. Since the minimum factor is
two, loops greater than one half of MAX_UNROLLED_INSNS will never two, loops greater than one half of MAX_UNROLLED_INSNS will never
...@@ -3635,7 +3635,7 @@ loop_iterations (loop) ...@@ -3635,7 +3635,7 @@ loop_iterations (loop)
int unsigned_p, compare_dir, final_larger; int unsigned_p, compare_dir, final_larger;
rtx last_loop_insn; rtx last_loop_insn;
rtx reg_term; rtx reg_term;
struct loop_info *loop_info = loop->info; struct loop_info *loop_info = LOOP_INFO (loop);
loop_info->n_iterations = 0; loop_info->n_iterations = 0;
loop_info->initial_value = 0; loop_info->initial_value = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment