summaryrefslogtreecommitdiffstats
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-05-10 14:33:50 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-05-10 14:33:50 +0000
commitd14771e1a27bc10d5ee62b1dcf52da6a8a0a5150 (patch)
treee2335c497a42925f221c9d78cbbb8475d085aec7 /gcc/unroll.c
parentdacd345b5a3a8b6be3e01c46481cde396a094a42 (diff)
downloadppe42-gcc-d14771e1a27bc10d5ee62b1dcf52da6a8a0a5150.tar.gz
ppe42-gcc-d14771e1a27bc10d5ee62b1dcf52da6a8a0a5150.zip
Add declarations of static functions.
(unroll_loop): Renumber reg local to loop for each unrolled iteration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9610 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c55
1 files changed, 46 insertions, 9 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index bebb17469cb..d5a58208d83 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -193,15 +193,22 @@ static rtx loop_final_value;
/* Forward declarations. */
-static void init_reg_map ();
-static int precondition_loop_p ();
-static void copy_loop_body ();
-static void iteration_info ();
-static rtx approx_final_value ();
-static int find_splittable_regs ();
-static int find_splittable_givs ();
-static rtx fold_rtx_mult_add ();
-static rtx remap_split_bivs ();
+static void init_reg_map PROTO((struct inline_remap *, int));
+static int precondition_loop_p PROTO((rtx *, rtx *, rtx *, rtx, rtx));
+static rtx calculate_giv_inc PROTO((rtx, rtx, int));
+static rtx initial_reg_note_copy PROTO((rtx, struct inline_remap *));
+static void final_reg_note_copy PROTO((rtx, struct inline_remap *));
+static void copy_loop_body PROTO((rtx, rtx, struct inline_remap *, rtx, int,
+ enum unroll_types, rtx, rtx, rtx, rtx));
+static int back_branch_in_range_p PROTO((rtx, rtx, rtx));
+static void iteration_info PROTO((rtx, rtx *, rtx *, rtx, rtx));
+static rtx approx_final_value PROTO((enum rtx_code, rtx, int *, int *));
+static int find_splittable_regs PROTO((enum unroll_types, rtx, rtx, rtx, int));
+static int find_splittable_givs PROTO((struct iv_class *,enum unroll_types,
+ rtx, rtx, rtx, int));
+static int reg_dead_after_loop PROTO((rtx, rtx, rtx));
+static rtx fold_rtx_mult_add PROTO((rtx, rtx, rtx, enum machine_mode));
+static rtx remap_split_bivs PROTO((rtx));
/* Try to unroll one loop and split induction variables in the loop.
@@ -231,6 +238,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
rtx insert_before;
struct inline_remap *map;
char *local_label;
+ char *local_regno;
int maxregnum;
int new_maxregnum;
rtx exit_label = 0;
@@ -711,6 +719,27 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
addr_combined_regs
= (struct induction **) alloca (maxregnum * sizeof (struct induction *));
bzero ((char *) addr_combined_regs, maxregnum * sizeof (struct induction *));
+ local_regno = (char *) alloca (maxregnum);
+ bzero (local_regno, maxregnum);
+
+ /* Mark all local registers, i.e. the ones which are referenced only
+ inside the loop. */
+ {
+ int copy_start_luid = INSN_LUID (copy_start);
+ int copy_end_luid = INSN_LUID (copy_end);
+
+ for (j = 0; j < maxregnum; ++j)
+ {
+ int first_uid = regno_first_uid[j];
+ int last_uid = regno_last_uid[j];
+
+ if (first_uid > 0 && first_uid <= max_uid_for_loop
+ && uid_luid[first_uid] >= copy_start_luid
+ && last_uid > 0 && last_uid <= max_uid_for_loop
+ && uid_luid[last_uid] <= copy_end_luid)
+ local_regno[j] = 1;
+ }
+ }
/* If this loop requires exit tests when unrolled, check to see if we
can precondition the loop so as to make the exit tests unnecessary.
@@ -923,6 +952,10 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
if (local_label[j])
map->label_map[j] = gen_label_rtx ();
+ for (j = 0; j < maxregnum; j++)
+ if (local_regno[j])
+ map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j]));
+
/* The last copy needs the compare/branch insns at the end,
so reset copy_end here if the loop ends with a conditional
branch. */
@@ -1060,6 +1093,10 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
if (local_label[j])
map->label_map[j] = gen_label_rtx ();
+ for (j = 0; j < maxregnum; j++)
+ if (local_regno[j])
+ map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j]));
+
/* If loop starts with a branch to the test, then fix it so that
it points to the test of the first unrolled copy of the loop. */
if (i == 0 && loop_start != copy_start)
OpenPOWER on IntegriCloud