Commit 8ffa0351 by Bernd Schmidt Committed by Bernd Schmidt

regrename.c (struct du_head): Make nregs signed.

	* regrename.c (struct du_head): Make nregs signed.
	(closed_chains): Remove.
	(create_new_chain): Return the new chain.
	(chain_from_id): New static function.
	(dump_def_use_chain): Change argument to be an int, indicating
	the first ID to print.  All callers changed.
	(merge_overlapping_regs): Use chain_from_id.  Assert that
	chains don't conflict with themselves.
	(rename_chains): Take no argument.  Iterate over id_to_chain
	rather to find chains to rename.  Clear tick before the main
	loop.
	(struct incoming_reg_info): New struct.
	(struct bb_rename_info): New struct.
	(init_rename_info, set_incoming_from_chain, merge_chains): New
	static functions.
	(regrename_analyze): New static function, broken out of
	regrename_optimize.  Record and make use of open chain information
	at basic block boundaries, and merge chains where possible.
	(scan_rtx_reg): Make this_nregs signed.  Don't update
	closed_chains.
	(build_def_use): Return a bool to indicate success.  All callers
	changed.  Don't initialize global data here.
	(regrename_optimize): Move most code out of here into
	regrename_analyze.
	* regs.h (add_range_to_hard_reg_set, remove_range_from_hard_reg_set,
	range_overlaps_hard_reg_set_p, range_in_hard_reg_set_p): New
	static inline functions.
	* vec.h (FOR_EACH_VEC_ELT_FROM): New macro.

From-SVN: r178645
parent a81462f1
2011-09-07 Bernd Schmidt <bernds@codesourcery.com>
* regrename.c (struct du_head): Make nregs signed.
(closed_chains): Remove.
(create_new_chain): Return the new chain.
(chain_from_id): New static function.
(dump_def_use_chain): Change argument to be an int, indicating
the first ID to print. All callers changed.
(merge_overlapping_regs): Use chain_from_id. Assert that
chains don't conflict with themselves.
(rename_chains): Take no argument. Iterate over id_to_chain
rather to find chains to rename. Clear tick before the main
loop.
(struct incoming_reg_info): New struct.
(struct bb_rename_info): New struct.
(init_rename_info, set_incoming_from_chain, merge_chains): New
static functions.
(regrename_analyze): New static function, broken out of
regrename_optimize. Record and make use of open chain information
at basic block boundaries, and merge chains where possible.
(scan_rtx_reg): Make this_nregs signed. Don't update
closed_chains.
(build_def_use): Return a bool to indicate success. All callers
changed. Don't initialize global data here.
(regrename_optimize): Move most code out of here into
regrename_analyze.
* regs.h (add_range_to_hard_reg_set, remove_range_from_hard_reg_set,
range_overlaps_hard_reg_set_p, range_in_hard_reg_set_p): New
static inline functions.
* vec.h (FOR_EACH_VEC_ELT_FROM): New macro.
2011-09-07 Martin Jambor <mjambor@suse.cz>
PR middle-end/50301
......@@ -397,4 +397,48 @@ overlaps_hard_reg_set_p (const HARD_REG_SET regs, enum machine_mode mode,
return false;
}
/* Like add_to_hard_reg_set, but use a REGNO/NREGS range instead of
REGNO and MODE. */
static inline void
add_range_to_hard_reg_set (HARD_REG_SET *regs, unsigned int regno,
int nregs)
{
while (nregs-- > 0)
SET_HARD_REG_BIT (*regs, regno + nregs);
}
/* Likewise, but remove the registers. */
static inline void
remove_range_from_hard_reg_set (HARD_REG_SET *regs, unsigned int regno,
int nregs)
{
while (nregs-- > 0)
CLEAR_HARD_REG_BIT (*regs, regno + nregs);
}
/* Like overlaps_hard_reg_set_p, but use a REGNO/NREGS range instead of
REGNO and MODE. */
static inline bool
range_overlaps_hard_reg_set_p (const HARD_REG_SET set, unsigned regno,
int nregs)
{
while (nregs-- > 0)
if (TEST_HARD_REG_BIT (set, regno + nregs))
return true;
return false;
}
/* Like in_hard_reg_set_p, but use a REGNO/NREGS range instead of
REGNO and MODE. */
static inline bool
range_in_hard_reg_set_p (const HARD_REG_SET set, unsigned regno, int nregs)
{
while (nregs-- > 0)
if (!TEST_HARD_REG_BIT (set, regno + nregs))
return false;
return true;
}
#endif /* GCC_REGS_H */
......@@ -195,6 +195,11 @@ along with GCC; see the file COPYING3. If not see
#define FOR_EACH_VEC_ELT(T, V, I, P) \
for (I = 0; VEC_iterate (T, (V), (I), (P)); ++(I))
/* Likewise, but start from FROM rather than 0. */
#define FOR_EACH_VEC_ELT_FROM(T, V, I, P, FROM) \
for (I = (FROM); VEC_iterate (T, (V), (I), (P)); ++(I))
/* Convenience macro for reverse iteration. */
#define FOR_EACH_VEC_ELT_REVERSE(T,V,I,P) \
......
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