Commit fd5d5b07 by Kazu Hirata Committed by Jeff Law

loop.c: Fix formatting.

        * loop.c: Fix formatting.
        * loop.h: Likewise.

From-SVN: r36400
parent f903ebb1
2000-09-13 Kazu Hirata <kazu@hxi.com>
* loop.c: Fix formatting.
* loop.h: Likewise.
2000-09-13 Richard Henderson <rth@cygnus.com> 2000-09-13 Richard Henderson <rth@cygnus.com>
* config/ia64/ia64.md (divsf3): New. * config/ia64/ia64.md (divsf3): New.
......
...@@ -78,9 +78,6 @@ static int max_luid; ...@@ -78,9 +78,6 @@ static int max_luid;
static int max_loop_num; static int max_loop_num;
/* Bound on pseudo register number before loop optimization. /* Bound on pseudo register number before loop optimization.
A pseudo has valid regscan info if its number is < max_reg_before_loop. */ A pseudo has valid regscan info if its number is < max_reg_before_loop. */
unsigned int max_reg_before_loop; unsigned int max_reg_before_loop;
...@@ -258,7 +255,8 @@ static int iv_add_mult_cost PARAMS ((rtx, rtx, rtx, rtx)); ...@@ -258,7 +255,8 @@ static int iv_add_mult_cost PARAMS ((rtx, rtx, rtx, rtx));
static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int)); static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int));
void debug_loop PARAMS ((const struct loop *)); void debug_loop PARAMS ((const struct loop *));
typedef struct rtx_pair { typedef struct rtx_pair
{
rtx r1; rtx r1;
rtx r2; rtx r2;
} rtx_pair; } rtx_pair;
...@@ -283,7 +281,8 @@ static int indirect_jump_in_function_p PARAMS ((rtx)); ...@@ -283,7 +281,8 @@ static int indirect_jump_in_function_p PARAMS ((rtx));
static int compute_luids PARAMS ((rtx, rtx, int)); static int compute_luids PARAMS ((rtx, rtx, int));
static int biv_elimination_giv_has_0_offset PARAMS ((struct induction *, static int biv_elimination_giv_has_0_offset PARAMS ((struct induction *,
struct induction *, rtx)); struct induction *,
rtx));
/* Benefit penalty, if a giv is not replaceable, i.e. must emit an insn to /* Benefit penalty, if a giv is not replaceable, i.e. must emit an insn to
copy the value of the strength reduced giv to its original register. */ copy the value of the strength reduced giv to its original register. */
...@@ -2587,8 +2586,7 @@ find_and_verify_loops (f, loops) ...@@ -2587,8 +2586,7 @@ find_and_verify_loops (f, loops)
cont. */ cont. */
if ((INSN_LUID (label) if ((INSN_LUID (label)
< INSN_LUID (loop->cont)) < INSN_LUID (loop->cont))
&& (INSN_LUID (label) && (INSN_LUID (label) > INSN_LUID (loop->start))
> INSN_LUID (loop->start))
/* And if there is no later destination already /* And if there is no later destination already
recorded. */ recorded. */
&& (! loop->cont_dominator && (! loop->cont_dominator
...@@ -2812,9 +2810,9 @@ find_and_verify_loops (f, loops) ...@@ -2812,9 +2810,9 @@ find_and_verify_loops (f, loops)
off LABEL_OUTSIDE_LOOP_P bit. */ off LABEL_OUTSIDE_LOOP_P bit. */
if (JUMP_LABEL (insn)) if (JUMP_LABEL (insn))
{ {
for (q = 0, for (q = 0, r = this_loop->exit_labels;
r = this_loop->exit_labels; r;
r; q = r, r = LABEL_NEXTREF (r)) q = r, r = LABEL_NEXTREF (r))
if (XEXP (r, 0) == JUMP_LABEL (insn)) if (XEXP (r, 0) == JUMP_LABEL (insn))
{ {
LABEL_OUTSIDE_LOOP_P (r) = 0; LABEL_OUTSIDE_LOOP_P (r) = 0;
...@@ -5967,7 +5965,7 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location) ...@@ -5967,7 +5965,7 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
inc_val, mult_val, location)) inc_val, mult_val, location))
return 1; return 1;
} }
/* ... fall through ... */ /* Fall through. */
/* Can accept constant setting of biv only when inside inner most loop. /* Can accept constant setting of biv only when inside inner most loop.
Otherwise, a biv of an inner loop may be incorrectly recognized Otherwise, a biv of an inner loop may be incorrectly recognized
...@@ -6514,7 +6512,11 @@ simplify_giv_expr (loop, x, ext_val, benefit) ...@@ -6514,7 +6512,11 @@ simplify_giv_expr (loop, x, ext_val, benefit)
{ {
int i = m->consec; int i = m->consec;
tem = m->insn; tem = m->insn;
do { tem = NEXT_INSN (tem); } while (--i > 0); do
{
tem = NEXT_INSN (tem);
}
while (--i > 0);
tem = find_reg_note (tem, REG_EQUAL, NULL_RTX); tem = find_reg_note (tem, REG_EQUAL, NULL_RTX);
if (tem) if (tem)
...@@ -7123,7 +7125,7 @@ check_ext_dependant_givs (bl, loop_info) ...@@ -7123,7 +7125,7 @@ check_ext_dependant_givs (bl, loop_info)
{ {
if (loop_dump_stream) if (loop_dump_stream)
{ {
fprintf(loop_dump_stream, fprintf (loop_dump_stream,
"Verified ext dependant giv at %d of reg %d\n", "Verified ext dependant giv at %d of reg %d\n",
INSN_UID (v->insn), bl->regno); INSN_UID (v->insn), bl->regno);
} }
...@@ -7146,7 +7148,7 @@ check_ext_dependant_givs (bl, loop_info) ...@@ -7146,7 +7148,7 @@ check_ext_dependant_givs (bl, loop_info)
why = "biv iteration info incomplete"; why = "biv iteration info incomplete";
} }
fprintf(loop_dump_stream, fprintf (loop_dump_stream,
"Failed ext dependant giv at %d, %s\n", "Failed ext dependant giv at %d, %s\n",
INSN_UID (v->insn), why); INSN_UID (v->insn), why);
} }
...@@ -8379,7 +8381,7 @@ check_dbra_loop (loop, insn_count) ...@@ -8379,7 +8381,7 @@ check_dbra_loop (loop, insn_count)
jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 1); jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 1);
if (jump_label == pc_rtx) if (jump_label == pc_rtx)
jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 2); jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 2);
new_add_val = GEN_INT (- INTVAL (bl->biv->add_val)); new_add_val = GEN_INT (-INTVAL (bl->biv->add_val));
/* Set start_value; if this is not a CONST_INT, we need /* Set start_value; if this is not a CONST_INT, we need
to generate a SUB. to generate a SUB.
...@@ -8463,7 +8465,7 @@ check_dbra_loop (loop, insn_count) ...@@ -8463,7 +8465,7 @@ check_dbra_loop (loop, insn_count)
/* Inc LABEL_NUSES so that delete_insn will /* Inc LABEL_NUSES so that delete_insn will
not delete the label. */ not delete the label. */
LABEL_NUSES (XEXP (jump_label, 0)) ++; LABEL_NUSES (XEXP (jump_label, 0))++;
/* Emit an insn after the end of the loop to set the biv's /* Emit an insn after the end of the loop to set the biv's
proper exit value if it is used anywhere outside the loop. */ proper exit value if it is used anywhere outside the loop. */
...@@ -9553,7 +9555,7 @@ insert_loop_mem (mem, data) ...@@ -9553,7 +9555,7 @@ insert_loop_mem (mem, data)
else else
loop_info->mems_allocated = 32; loop_info->mems_allocated = 32;
loop_info->mems = (loop_mem_info*) loop_info->mems = (loop_mem_info *)
xrealloc (loop_info->mems, xrealloc (loop_info->mems,
loop_info->mems_allocated * sizeof (loop_mem_info)); loop_info->mems_allocated * sizeof (loop_mem_info));
} }
...@@ -10057,7 +10059,6 @@ try_copy_prop (loop, replacement, regno) ...@@ -10057,7 +10059,6 @@ try_copy_prop (loop, replacement, regno)
} }
} }
/* Try to replace occurrences of pseudo REGNO with REPLACEMENT within /* Try to replace occurrences of pseudo REGNO with REPLACEMENT within
loop LOOP if the order of the sets of these registers can be loop LOOP if the order of the sets of these registers can be
swapped. There must be exactly one insn within the loop that sets swapped. There must be exactly one insn within the loop that sets
...@@ -10145,7 +10146,6 @@ try_swap_copy_prop (loop, replacement, regno) ...@@ -10145,7 +10146,6 @@ try_swap_copy_prop (loop, replacement, regno)
} }
} }
/* Replace MEM with its associated pseudo register. This function is /* Replace MEM with its associated pseudo register. This function is
called from load_mems via for_each_rtx. DATA is actually a pointer called from load_mems via for_each_rtx. DATA is actually a pointer
to a structure describing the instruction currently being scanned to a structure describing the instruction currently being scanned
...@@ -10156,7 +10156,7 @@ replace_loop_mem (mem, data) ...@@ -10156,7 +10156,7 @@ replace_loop_mem (mem, data)
rtx *mem; rtx *mem;
void *data; void *data;
{ {
loop_replace_args *args = (loop_replace_args *)data; loop_replace_args *args = (loop_replace_args *) data;
rtx m = *mem; rtx m = *mem;
if (m == NULL_RTX) if (m == NULL_RTX)
...@@ -10187,7 +10187,6 @@ replace_loop_mem (mem, data) ...@@ -10187,7 +10187,6 @@ replace_loop_mem (mem, data)
return 0; return 0;
} }
static void static void
replace_loop_mems (insn, mem, reg) replace_loop_mems (insn, mem, reg)
rtx insn; rtx insn;
...@@ -10203,7 +10202,6 @@ replace_loop_mems (insn, mem, reg) ...@@ -10203,7 +10202,6 @@ replace_loop_mems (insn, mem, reg)
for_each_rtx (&insn, replace_loop_mem, &args); for_each_rtx (&insn, replace_loop_mem, &args);
} }
/* Replace one register with another. Called through for_each_rtx; PX points /* Replace one register with another. Called through for_each_rtx; PX points
to the rtx being scanned. DATA is actually a pointer to to the rtx being scanned. DATA is actually a pointer to
a structure of arguments. */ a structure of arguments. */
...@@ -10214,7 +10212,7 @@ replace_loop_reg (px, data) ...@@ -10214,7 +10212,7 @@ replace_loop_reg (px, data)
void *data; void *data;
{ {
rtx x = *px; rtx x = *px;
loop_replace_args *args = (loop_replace_args *)data; loop_replace_args *args = (loop_replace_args *) data;
if (x == NULL_RTX) if (x == NULL_RTX)
return 0; return 0;
...@@ -10225,7 +10223,6 @@ replace_loop_reg (px, data) ...@@ -10225,7 +10223,6 @@ replace_loop_reg (px, data)
return 0; return 0;
} }
static void static void
replace_loop_regs (insn, reg, replacement) replace_loop_regs (insn, reg, replacement)
rtx insn; rtx insn;
...@@ -10241,7 +10238,6 @@ replace_loop_regs (insn, reg, replacement) ...@@ -10241,7 +10238,6 @@ replace_loop_regs (insn, reg, replacement)
for_each_rtx (&insn, replace_loop_reg, &args); for_each_rtx (&insn, replace_loop_reg, &args);
} }
/* Replace occurrences of the old exit label for the loop with the new /* Replace occurrences of the old exit label for the loop with the new
one. DATA is an rtx_pair containing the old and new labels, one. DATA is an rtx_pair containing the old and new labels,
respectively. */ respectively. */
...@@ -10283,7 +10279,8 @@ replace_label (x, data) ...@@ -10283,7 +10279,8 @@ replace_label (x, data)
#define LOOP_INSN_UID(INSN) ((INSN) ? INSN_UID (INSN) : -1) #define LOOP_INSN_UID(INSN) ((INSN) ? INSN_UID (INSN) : -1)
static void loop_dump_aux (loop, file, verbose) static void
loop_dump_aux (loop, file, verbose)
const struct loop *loop; const struct loop *loop;
FILE *file; FILE *file;
int verbose; int verbose;
...@@ -10324,7 +10321,7 @@ static void loop_dump_aux (loop, file, verbose) ...@@ -10324,7 +10321,7 @@ static void loop_dump_aux (loop, file, verbose)
LOOP_INSN_UID (loop->end)); LOOP_INSN_UID (loop->end));
fprintf (file, ";; top %d (%d), scan start %d (%d)\n", fprintf (file, ";; top %d (%d), scan start %d (%d)\n",
LOOP_BLOCK_NUM (loop->top), LOOP_BLOCK_NUM (loop->top),
LOOP_INSN_UID (loop->top) , LOOP_INSN_UID (loop->top),
LOOP_BLOCK_NUM (loop->scan_start), LOOP_BLOCK_NUM (loop->scan_start),
LOOP_INSN_UID (loop->scan_start)); LOOP_INSN_UID (loop->scan_start));
fprintf (file, ";; exit_count %d", loop->exit_count); fprintf (file, ";; exit_count %d", loop->exit_count);
...@@ -10347,7 +10344,6 @@ static void loop_dump_aux (loop, file, verbose) ...@@ -10347,7 +10344,6 @@ static void loop_dump_aux (loop, file, verbose)
} }
} }
/* Call this function from the debugger to dump LOOP. */ /* Call this function from the debugger to dump LOOP. */
void void
......
...@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
#define LOOP_UNROLL 1 #define LOOP_UNROLL 1
#define LOOP_BCT 2 #define LOOP_BCT 2
/* Get the loop info pointer of a loop. */ /* Get the loop info pointer of a loop. */
#define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux) #define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux)
...@@ -52,7 +51,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -52,7 +51,11 @@ Boston, MA 02111-1307, USA. */
/* An enum for the two different types of givs, those that are used /* An enum for the two different types of givs, those that are used
as memory addresses and those that are calculated into registers. */ as memory addresses and those that are calculated into registers. */
enum g_types { DEST_ADDR, DEST_REG }; enum g_types
{
DEST_ADDR,
DEST_REG
};
/* A `struct induction' is created for every instruction that sets /* A `struct induction' is created for every instruction that sets
an induction variable (either a biv or a giv). */ an induction variable (either a biv or a giv). */
...@@ -148,7 +151,8 @@ struct induction ...@@ -148,7 +151,8 @@ struct induction
/* A `struct iv_class' is created for each biv. */ /* A `struct iv_class' is created for each biv. */
struct iv_class { struct iv_class
{
unsigned int regno; /* Pseudo reg which is the biv. */ unsigned int regno; /* Pseudo reg which is the biv. */
int biv_count; /* Number of insns setting this reg. */ int biv_count; /* Number of insns setting this reg. */
struct induction *biv; /* List of all insns that set this reg. */ struct induction *biv; /* List of all insns that set this reg. */
...@@ -170,7 +174,6 @@ struct iv_class { ...@@ -170,7 +174,6 @@ struct iv_class {
biv controls. */ biv controls. */
}; };
typedef struct loop_mem_info typedef struct loop_mem_info
{ {
rtx mem; /* The MEM itself. */ rtx mem; /* The MEM itself. */
...@@ -178,7 +181,6 @@ typedef struct loop_mem_info ...@@ -178,7 +181,6 @@ typedef struct loop_mem_info
int optimize; /* Nonzero if we can optimize access to this MEM. */ int optimize; /* Nonzero if we can optimize access to this MEM. */
} loop_mem_info; } loop_mem_info;
struct loop_ivs struct loop_ivs
{ {
/* Indexed by register number, indicates whether or not register is /* Indexed by register number, indicates whether or not register is
...@@ -207,7 +209,6 @@ struct loop_ivs ...@@ -207,7 +209,6 @@ struct loop_ivs
unsigned int last_increment_giv; unsigned int last_increment_giv;
}; };
struct loop_regs struct loop_regs
{ {
int num; int num;
...@@ -245,7 +246,6 @@ struct loop_regs ...@@ -245,7 +246,6 @@ struct loop_regs
int multiple_uses; int multiple_uses;
}; };
/* Information pertaining to a loop. */ /* Information pertaining to a loop. */
struct loop_info struct loop_info
...@@ -321,8 +321,13 @@ struct loop_info ...@@ -321,8 +321,13 @@ struct loop_info
}; };
/* Definitions used by the basic induction variable discovery code. */ /* Definitions used by the basic induction variable discovery code. */
enum iv_mode { UNKNOWN_INDUCT, BASIC_INDUCT, NOT_BASIC_INDUCT, enum iv_mode
GENERAL_INDUCT }; {
UNKNOWN_INDUCT,
BASIC_INDUCT,
NOT_BASIC_INDUCT,
GENERAL_INDUCT
};
/* Variables declared in loop.c, but also needed in unroll.c. */ /* Variables declared in loop.c, but also needed in unroll.c. */
......
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