Commit 7a403706 by Kazu Hirata Committed by Jeff Law

* haifa-sched.c: Fix formatting.

From-SVN: r36367
parent 2ee7b20c
......@@ -18,6 +18,8 @@ Tue Sep 12 08:53:57 2000 Jeffrey A Law (law@cygnus.com)
2000-09-12 Kazu Hirata <kazu@hxi.com>
* haifa-sched.c: Fix formatting.
* genattrtab.c: Fix formatting.
* unroll.c: Fix formatting.
......
......@@ -21,7 +21,6 @@ along with GNU CC; see the file COPYING. If not, write to the Free
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* Instruction scheduling pass.
This pass implements list scheduling within basic blocks. It is
......@@ -214,7 +213,6 @@ static int sched_verbose = 0;
/* nr_inter/spec counts interblock/speculative motion for the function. */
static int nr_inter, nr_spec;
/* Debugging file. All printouts are sent to dump, which is always set,
either to stderr, or to the dump listing file (-dRS). */
static FILE *dump = 0;
......@@ -502,12 +500,12 @@ static void adjust_priority PARAMS ((rtx));
/* Control flow graph edges are kept in circular lists. */
typedef struct
{
{
int from_block;
int to_block;
int next_in;
int next_out;
}
}
haifa_edge;
static haifa_edge *edge_table;
......@@ -527,21 +525,18 @@ static int *out_edges;
#define IN_EDGES(block) (in_edges[block])
#define OUT_EDGES(block) (out_edges[block])
static int is_cfg_nonregular PARAMS ((void));
static int build_control_flow PARAMS ((struct edge_list *));
static void new_edge PARAMS ((int, int));
/* A region is the main entity for interblock scheduling: insns
are allowed to move between blocks in the same region, along
control flow graph edges, in the 'up' direction. */
typedef struct
{
{
int rgn_nr_blocks; /* Number of blocks in region. */
int rgn_blocks; /* cblocks in the region (actually index in rgn_bb_table). */
}
}
region;
/* Number of regions in the procedure. */
......@@ -581,16 +576,15 @@ static int current_blocks;
/* The mapping from bb to block. */
#define BB_TO_BLOCK(bb) (rgn_bb_table[current_blocks + (bb)])
/* Bit vectors and bitset operations are needed for computations on
the control flow graph. */
typedef unsigned HOST_WIDE_INT *bitset;
typedef struct
{
{
int *first_member; /* Pointer to the list start in bitlst_table. */
int nr_members; /* The number of members of the bit list. */
}
}
bitlst;
static int bitlst_table_last;
......@@ -608,13 +602,13 @@ static void extract_bitlst PARAMS ((bitset, int, int, bitlst *));
about such sources: are they valid? Speculative? Etc. */
typedef bitlst bblst;
typedef struct
{
{
char is_valid;
char is_speculative;
int src_prob;
bblst split_bbs;
bblst update_bbs;
}
}
candidate;
static candidate *candidate_table;
......@@ -644,7 +638,6 @@ static void compute_trg_info PARAMS ((int));
void debug_candidate PARAMS ((int));
void debug_candidates PARAMS ((int));
/* Bit-set of bbs, where bit 'i' stands for bb 'i'. */
typedef bitset bbset;
......@@ -769,7 +762,7 @@ static rtx reemit_notes PARAMS ((rtx, rtx));
static void get_block_head_tail PARAMS ((int, rtx *, rtx *));
static void get_bb_head_tail PARAMS ((int, rtx *, rtx *));
static int queue_to_ready PARAMS ((rtx [], int));
static int queue_to_ready PARAMS ((rtx[], int));
static void debug_ready_list PARAMS ((rtx[], int));
static void init_target_units PARAMS ((void));
......@@ -881,7 +874,7 @@ add_dependence (insn, elem, dep_type)
#ifdef INSN_SCHEDULING
/* If we are adding a true dependency to INSN's LOG_LINKs, then
note that in the bitmap cache of true dependency information. */
if ((int)dep_type == 0 && true_dependency_cache)
if ((int) dep_type == 0 && true_dependency_cache)
SET_BIT (true_dependency_cache[INSN_LUID (insn)], INSN_LUID (elem));
#endif
return;
......@@ -897,7 +890,7 @@ add_dependence (insn, elem, dep_type)
#ifdef INSN_SCHEDULING
/* If we are adding a true dependency to INSN's LOG_LINKs, then
note that in the bitmap cache of true dependency information. */
if ((int)dep_type == 0 && true_dependency_cache)
if ((int) dep_type == 0 && true_dependency_cache)
SET_BIT (true_dependency_cache[INSN_LUID (insn)], INSN_LUID (elem));
#endif
}
......@@ -1134,7 +1127,6 @@ build_control_flow (edge_list)
return unreachable;
}
/* Record an edge in the control flow graph from SOURCE to TARGET.
In theory, this is redundant with the s_succs computed above, but
......@@ -1194,7 +1186,6 @@ new_edge (source, target)
}
}
/* BITSET macros for operations on the control flow graph. */
/* Compute bitwise union of two bitsets. */
......@@ -1245,7 +1236,6 @@ do { register bitset tmpset = set; \
~(1 << (index%HOST_BITS_PER_WIDE_INT)); \
}
/* Check if the index'th bit in bitset set is on. */
static char
......@@ -1259,7 +1249,6 @@ bitset_member (set, index, len)
1 << (index % HOST_BITS_PER_WIDE_INT)) ? 1 : 0;
}
/* Translate a bit-set SET to a list BL of the bit-set members. */
static void
......@@ -1300,7 +1289,6 @@ extract_bitlst (set, len, bitlen, bl)
}
/* Functions for the construction of regions. */
/* Print the regions, for debugging purposes. Callable from debugger. */
......@@ -1331,7 +1319,6 @@ debug_regions ()
}
}
/* Build a single block region for each basic block in the function.
This allows for using the same code for interblock and basic block
scheduling. */
......@@ -1352,7 +1339,6 @@ find_single_block_region ()
nr_regions = n_basic_blocks;
}
/* Update number of blocks and the estimate for number of insns
in the region. Return 1 if the region is "too large" for interblock
scheduling (compile time considerations), otherwise return 0. */
......@@ -1370,7 +1356,6 @@ too_large (block, num_bbs, num_insns)
return 0;
}
/* Update_loop_relations(blk, hdr): Check if the loop headed by max_hdr[blk]
is still an inner loop. Put in max_hdr[blk] the header of the most inner
loop containing blk. */
......@@ -1387,7 +1372,6 @@ too_large (block, num_bbs, num_insns)
} \
}
/* Find regions for interblock scheduling.
A region for scheduling can be:
......@@ -1398,7 +1382,6 @@ too_large (block, num_bbs, num_insns)
* A basic block not contained in any other region.
?!? In theory we could build other regions based on extended basic
blocks or reverse extended basic blocks. Is it worth the trouble?
......@@ -1413,7 +1396,6 @@ too_large (block, num_bbs, num_insns)
* block_to_bb
* containing region
We use dominator relationships to avoid making regions out of non-reducible
loops.
......@@ -1663,7 +1645,6 @@ find_rgns (edge_list, dom)
num_insns = (INSN_LUID (BLOCK_END (i))
- INSN_LUID (BLOCK_HEAD (i)));
/* Find all loop latches (blocks with back edges to the loop
header) or all the leaf blocks in the cfg has no loops.
......@@ -1710,7 +1691,6 @@ find_rgns (edge_list, dom)
break;
}
}
}
}
......@@ -1725,7 +1705,6 @@ find_rgns (edge_list, dom)
c a,d
d b
The algorithm in the DFS traversal may not mark B & D as part
of the loop (ie they will not have max_hdr set to A).
......@@ -1843,7 +1822,6 @@ find_rgns (edge_list, dom)
free (in_stack);
}
/* Functions for regions scheduling information. */
/* Compute dominators, probability, and potential-split-edges of bb.
......@@ -1921,8 +1899,9 @@ compute_dom_prob_ps (bb)
BITSET_DIFFER (pot_split[bb], ancestor_edges[bb], edgeset_size);
if (sched_verbose >= 2)
fprintf (dump, ";; bb_prob(%d, %d) = %3d\n", bb, BB_TO_BLOCK (bb), (int) (100.0 * prob[bb]));
} /* compute_dom_prob_ps */
fprintf (dump, ";; bb_prob(%d, %d) = %3d\n", bb, BB_TO_BLOCK (bb),
(int) (100.0 * prob[bb]));
}
/* Functions for target info. */
......@@ -1945,7 +1924,6 @@ split_edges (bb_src, bb_trg, bl)
free (src);
}
/* Find the valid candidate-source-blocks for the target block TRG, compute
their probability, and check if they are speculative or not.
For speculative sources, compute their update-blocks and split-blocks. */
......@@ -2024,8 +2002,7 @@ compute_trg_info (trg)
sp->src_prob = 0;
}
}
} /* compute_trg_info */
}
/* Print candidates info, for debugging purposes. Callable from debugger. */
......@@ -2065,7 +2042,6 @@ debug_candidate (i)
}
}
/* Print candidates info, for debugging purposes. Callable from debugger. */
void
......@@ -2080,7 +2056,6 @@ debug_candidates (trg)
debug_candidate (i);
}
/* Functions for speculative scheduing. */
/* Return 0 if x is a set of a register alive in the beginning of one
......@@ -2161,7 +2136,6 @@ check_live_1 (src, x)
return 1;
}
/* If x is a set of a register R, mark that R is alive in the beginning
of every update-block of src. */
......@@ -2227,7 +2201,6 @@ update_live_1 (src, x)
}
}
/* Return 1 if insn can be speculatively moved from block src to trg,
otherwise return 0. Called before first insertion of insn to
ready-list or before the scheduling. */
......@@ -2256,7 +2229,6 @@ check_live (insn, src)
return 1;
}
/* Update the live registers info after insn was moved speculatively from
block src to trg. */
......@@ -2586,8 +2558,7 @@ may_trap_exp (x, is_store)
}
return insn_class;
}
} /* may_trap_exp */
}
/* Classifies insn for the purpose of verifying that it can be
moved speculatively, by examining it's patterns, returning:
......@@ -2670,8 +2641,7 @@ haifa_classify_insn (insn)
}
return insn_class;
} /* haifa_classify_insn */
}
/* Return 1 if load_insn is prisky (i.e. if load_insn is fed by
a load moved speculatively, or if load_insn is protected by
......@@ -2693,7 +2663,7 @@ is_prisky (load_insn, bb_src, bb_trg)
return 1;
return 0;
} /* is_prisky */
}
/* Insn is a candidate to be moved speculatively from bb_src to bb_trg.
Return 1 if insn is exception-free (and the motion is valid)
......@@ -2739,8 +2709,7 @@ is_exception_free (insn, bb_src, bb_trg)
}
return flag_schedule_speculative_load_dangerous;
} /* is_exception_free */
}
/* Process an insn's memory dependencies. There are four kinds of
dependencies:
......@@ -2772,7 +2741,6 @@ find_insn_mem_list (insn, x, list, list1)
return 0;
}
/* Compute the function units used by INSN. This caches the value
returned by function_units_used. A function unit is encoded as the
unit number if the value is non-negative and the compliment of a
......@@ -3163,7 +3131,6 @@ priority (insn)
return this_priority;
}
/* Remove all INSN_LISTs and EXPR_LISTs from the pending lists and add
them to the unused_*_list variables, so that they can be reused. */
......@@ -4030,13 +3997,12 @@ rank_for_schedule (x, y)
const PTR x;
const PTR y;
{
rtx tmp = *(const rtx *)y;
rtx tmp2 = *(const rtx *)x;
rtx tmp = *(const rtx *) y;
rtx tmp2 = *(const rtx *) x;
rtx link;
int tmp_class, tmp2_class, depend_count1, depend_count2;
int val, priority_val, spec_val, prob_val, weight_val;
/* Prefer insn with higher priority. */
priority_val = INSN_PRIORITY (tmp2) - INSN_PRIORITY (tmp);
if (priority_val)
......@@ -4470,7 +4436,6 @@ save_line_notes (bb)
LINE_NOTE (insn) = line;
}
/* After bb was scheduled, insert line notes into the insns list. */
static void
......@@ -4725,7 +4690,8 @@ queue_to_ready (ready, n_ready)
q_size -= 1;
if (sched_verbose >= 2)
fprintf (dump, ";;\t\tQ-->Ready: insn %d: ", INSN_UID (insn));
fprintf (dump, ";;\t\tQ-->Ready: insn %d: ",
INSN_UID (insn));
if (sched_verbose >= 2 && INSN_BB (insn) != target_bb)
fprintf (dump, "(b%d) ", BLOCK_NUM (insn));
......@@ -4904,14 +4870,14 @@ print_exp (buf, x, verbose)
char tmp[BUF_LEN];
const char *st[4];
char *cur = buf;
const char *fun = (char *)0;
const char *fun = (char *) 0;
const char *sep;
rtx op[4];
int i;
for (i = 0; i < 4; i++)
{
st[i] = (char *)0;
st[i] = (char *) 0;
op[i] = NULL_RTX;
}
......@@ -5259,7 +5225,7 @@ print_value (buf, x, verbose)
cur = safe_concat (buf, cur, t);
break;
case CONST_DOUBLE:
sprintf (t, "<0x%lx,0x%lx>", (long)XWINT (x, 2), (long)XWINT (x, 3));
sprintf (t, "<0x%lx,0x%lx>", (long) XWINT (x, 2), (long) XWINT (x, 3));
cur = safe_concat (buf, cur, t);
break;
case CONST_STRING:
......@@ -5291,11 +5257,11 @@ print_value (buf, x, verbose)
case REG:
if (REGNO (x) < FIRST_PSEUDO_REGISTER)
{
int c = reg_names[ REGNO (x) ][0];
int c = reg_names[REGNO (x)][0];
if (c >= '0' && c <= '9')
cur = safe_concat (buf, cur, "%");
cur = safe_concat (buf, cur, reg_names[ REGNO (x) ]);
cur = safe_concat (buf, cur, reg_names[REGNO (x)]);
}
else
{
......@@ -5889,7 +5855,6 @@ schedule_block (bb, rgn_n_insns)
if (sched_verbose >= 5)
debug_dependencies ();
/* Initialize ready list with all 'ready' insns in target block.
Count number of insns in the target block being scheduled. */
n_ready = 0;
......@@ -6174,8 +6139,7 @@ schedule_block (bb, rgn_n_insns)
free (ready);
return (sched_n_insns);
} /* schedule_block () */
}
/* Print the bit-set of registers, S, callable from debugger. */
......@@ -7007,7 +6971,7 @@ schedule_insns (dump_file)
{
sbitmap_zero (blocks);
for (b = RGN_NR_BLOCKS (rgn) - 1; b >= 0; --b)
SET_BIT (blocks, rgn_bb_table [RGN_BLOCKS (rgn) + b]);
SET_BIT (blocks, rgn_bb_table[RGN_BLOCKS (rgn) + b]);
deaths_in_region[rgn] = count_or_remove_death_notes (blocks, 1);
}
......@@ -7080,7 +7044,8 @@ schedule_insns (dump_file)
{
if (reload_completed == 0 && flag_schedule_interblock)
{
fprintf (dump, "\n;; Procedure interblock/speculative motions == %d/%d \n",
fprintf (dump,
"\n;; Procedure interblock/speculative motions == %d/%d \n",
nr_inter, nr_spec);
}
else
......
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