aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 16:37:26 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 16:37:26 +0000
commite58b686eef320f916ee9930e94ee9d3a71191f71 (patch)
tree2d1855355370060941621d41c23d9363ea157e30
parent5aaf0cceb6c8305f19ae408fed5029d319f805ca (diff)
2007-06-07 Kenneth Zadeck <zadeck@naturalbridge.com>
* doc/rtl.text: Fixed spelling. * dse.c (store_info, read_info, insn_info, bb_info, group_info, deferred_change): Fixed formatting. (step0): Renamed to dse_step0. (step1): Renamed to dse_step1. (step2_init): Renamed to dse_step2_init. (step2_nospill): Renamed to dse_step2_nospill. (step2_spill): Renamed to dse_step2_spill. (step3_scan): Renamed to dse_step3_scan. (step3_exit_block_scan): Renamed to dse_step3_exit_block_scan. (step3): Renamed to dse_step3. (step4_nospill): Renamed to dse_step4_nospill. (step4_spill): Renamed to dse_step4_spill. (step4): Renamed to dse_step4. (step5_nospill): Renamed to dse_step5_nospill. (step5_spill): Renamed to dse_step5_spill. (step6): Renamed to dse_step6. (rest_of_handle_dse): Updated names of functions. * emit_rtl.c (verify_rtx_sharing, copy_rtx_if_shared_1, copy_insn_1): Now calls shared_const_p. * cselib.c (expand_loc, cselib_expand_value_rtx): Fixed comments. (cselib_expand_value_rtx): Now calls shared_const_p. * rtl.c (shared_const_p): New function. (copy_rtx): Now calls shared_const_p. * rtl.h (shared_const_p): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/dataflow-branch@125495 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.dataflow28
-rw-r--r--gcc/cselib.c12
-rw-r--r--gcc/doc/rtl.texi2
-rw-r--r--gcc/dse.c72
-rw-r--r--gcc/emit-rtl.c18
-rw-r--r--gcc/rtl.c21
-rw-r--r--gcc/rtl.h1
7 files changed, 92 insertions, 62 deletions
diff --git a/gcc/ChangeLog.dataflow b/gcc/ChangeLog.dataflow
index 5a9a2208cfa..2fb586f8b99 100644
--- a/gcc/ChangeLog.dataflow
+++ b/gcc/ChangeLog.dataflow
@@ -1,3 +1,31 @@
+2007-06-07 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * doc/rtl.text: Fixed spelling.
+ * dse.c (store_info, read_info, insn_info, bb_info, group_info,
+ deferred_change): Fixed formatting.
+ (step0): Renamed to dse_step0.
+ (step1): Renamed to dse_step1.
+ (step2_init): Renamed to dse_step2_init.
+ (step2_nospill): Renamed to dse_step2_nospill.
+ (step2_spill): Renamed to dse_step2_spill.
+ (step3_scan): Renamed to dse_step3_scan.
+ (step3_exit_block_scan): Renamed to dse_step3_exit_block_scan.
+ (step3): Renamed to dse_step3.
+ (step4_nospill): Renamed to dse_step4_nospill.
+ (step4_spill): Renamed to dse_step4_spill.
+ (step4): Renamed to dse_step4.
+ (step5_nospill): Renamed to dse_step5_nospill.
+ (step5_spill): Renamed to dse_step5_spill.
+ (step6): Renamed to dse_step6.
+ (rest_of_handle_dse): Updated names of functions.
+ * emit_rtl.c (verify_rtx_sharing, copy_rtx_if_shared_1,
+ copy_insn_1): Now calls shared_const_p.
+ * cselib.c (expand_loc, cselib_expand_value_rtx): Fixed comments.
+ (cselib_expand_value_rtx): Now calls shared_const_p.
+ * rtl.c (shared_const_p): New function.
+ (copy_rtx): Now calls shared_const_p.
+ * rtl.h (shared_const_p): New function.
+
2007-06-06 Kenneth Zadeck <zadeck@naturalbridge.com>
* combine.c (find_single_use_1): Fixed comment and changed 0 to NULL.
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 432822ba431..6c2b59abf52 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -899,7 +899,7 @@ expand_loc (struct elt_loc_list *p, bitmap regs_active, int max_depth)
}
-/* Forward substitute and expand an expression out to it's roots.
+/* Forward substitute and expand an expression out to its roots.
This is the opposite of common subexpression. Because local value
numbering is such a weak optimization, the expanded expression is
pretty much unique (not from a pointer equals point of view but
@@ -947,7 +947,7 @@ cselib_expand_value_rtx (rtx orig, bitmap regs_active, int max_depth)
rtx result;
int regno = REGNO (orig);
- /* The several thing that we are not willing to do (this
+ /* The only thing that we are not willing to do (this
is requirement of dse and if others potiential uses
need this function we should add a parm to control
it) is that we will not substitute the
@@ -961,7 +961,7 @@ cselib_expand_value_rtx (rtx orig, bitmap regs_active, int max_depth)
STACK_POINTER_REGNUM substitution, then dse will
think that parameter pushing also goes dead which is
wrong. If you allow the FRAME_POINTER or the
- HARD_FRAME_POINTER then you loose the opportunity to
+ HARD_FRAME_POINTER then you lose the opportunity to
make the frame assumptions. */
if (regno == STACK_POINTER_REGNUM
|| regno == FRAME_POINTER_REGNUM
@@ -999,11 +999,7 @@ cselib_expand_value_rtx (rtx orig, bitmap regs_active, int max_depth)
break;
case CONST:
- /* CONST can be shared if it contains a SYMBOL_REF. If it contains
- a LABEL_REF, it isn't sharable. */
- if (GET_CODE (XEXP (orig, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (orig, 0), 0)) == SYMBOL_REF
- && GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT)
+ if (shared_const_p (orig))
return orig;
break;
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index e3971a09fd0..09e73e1435d 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -3251,7 +3251,7 @@ file as some small positive or negative offset from a named pattern.
A list (chain of @code{insn_list} expressions) giving information about
dependencies between instructions within a basic block. Neither a jump
nor a label may come between the related insns. These are only used by
-the schedulars and by combine. This is a deprecated data structure.
+the schedulers and by combine. This is a deprecated data structure.
Def-use and use-def chains are now prefered.
@findex REG_NOTES
diff --git a/gcc/dse.c b/gcc/dse.c
index 456021fc158..0b15f95e3b3 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -159,7 +159,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
depends on reading tea leaves and chicken entrails left by reload.
This pass depends on reload creating a singleton alias set for each
spill slot and telling the next dse pass which of these alias sets
- are the singletons. Rather that analyze the addresses of the
+ are the singletons. Rather than analyze the addresses of the
spills, dse's spill processing just does analysis of the loads and
stores that use those alias sets. There are three cases where this
falls short:
@@ -198,7 +198,8 @@ static bitmap scratch = NULL;
struct insn_info;
/* This structure holds information about a candidate store. */
-struct store_info {
+struct store_info
+{
/* False means this is a clobber. */
bool is_set;
@@ -244,7 +245,8 @@ static alloc_pool rtx_store_info_pool;
/* This structure holds information about a load. These are only
built for rtx bases. */
-struct read_info {
+struct read_info
+{
/* The id of the mem group of the base address. */
int group_id;
@@ -268,7 +270,8 @@ static alloc_pool read_info_pool;
/* One of these records is created for each insn. */
-struct insn_info {
+struct insn_info
+{
/* Set true if the insn contains a store but the insn itself cannot
be deleted. This is set if the insn is a parallel and there is
more than one non dead output or if the insn is in some way
@@ -327,7 +330,8 @@ static alloc_pool insn_info_pool;
basic block. */
static insn_info_t active_local_stores;
-struct bb_info {
+struct bb_info
+{
/* Pointer to the insn info for the last insn in the block. These
are linked so this is how all of the insns are reached. During
@@ -382,7 +386,8 @@ static bb_info_t *bb_table;
memory. There are also not many of the rtx bases because they are
very limited in scope. */
-struct group_info {
+struct group_info
+{
/* The actual base of the address. */
rtx rtx_base;
@@ -452,7 +457,8 @@ static VEC(group_info_t,heap) *rtx_group_vec;
/* This structure holds the set of changes that are being deferred
when removing read operation. See replace_read. */
-struct deferred_change {
+struct deferred_change
+{
/* The mem that is being replaced. */
rtx *loc;
@@ -652,7 +658,7 @@ get_group_info (rtx base)
/* Initialization of data structures. */
static void
-step0 (void)
+dse_step0 (void)
{
locally_deleted = 0;
globally_deleted = 0;
@@ -1897,7 +1903,7 @@ remove_useless_values (cselib_val *base)
/* Do all of step 1. */
static void
-step1 (void)
+dse_step1 (void)
{
basic_block bb;
@@ -2015,7 +2021,7 @@ step1 (void)
----------------------------------------------------------------------------*/
static void
-step2_init (void)
+dse_step2_init (void)
{
unsigned int i;
group_info_t group;
@@ -2064,7 +2070,7 @@ step2_init (void)
/* Init the offset tables for the normal case. */
static bool
-step2_nospill (void)
+dse_step2_nospill (void)
{
unsigned int i;
group_info_t group;
@@ -2104,7 +2110,7 @@ step2_nospill (void)
/* Init the offset tables for the spill case. */
static bool
-step2_spill (void)
+dse_step2_spill (void)
{
unsigned int j;
group_info_t group = clear_alias_group;
@@ -2443,7 +2449,7 @@ find_insn_before_first_wild_read (bb_info_t bb_info)
anything that happens is hidden by the wild read. */
static void
-step3_scan (bool for_spills, basic_block bb)
+dse_step3_scan (bool for_spills, basic_block bb)
{
bb_info_t bb_info = bb_table[bb->index];
insn_info_t insn_info;
@@ -2495,7 +2501,7 @@ step3_scan (bool for_spills, basic_block bb)
successors that does not have a wild read. */
static void
-step3_exit_block_scan (bb_info_t bb_info)
+dse_step3_exit_block_scan (bb_info_t bb_info)
{
/* The gen set is all 0's for the exit block except for the
frame_pointer_group. */
@@ -2538,7 +2544,7 @@ mark_reachable_blocks (sbitmap unreachable_blocks, basic_block bb)
/* Build the transfer functions for the function. */
static void
-step3 (bool for_spills)
+dse_step3 (bool for_spills)
{
basic_block bb;
sbitmap unreachable_blocks = sbitmap_alloc (last_basic_block);
@@ -2559,9 +2565,9 @@ step3 (bool for_spills)
if (bb->index == ENTRY_BLOCK)
;
else if (bb->index == EXIT_BLOCK)
- step3_exit_block_scan (bb_info);
+ dse_step3_exit_block_scan (bb_info);
else
- step3_scan (for_spills, bb);
+ dse_step3_scan (for_spills, bb);
if (EDGE_COUNT (bb->succs) == 0)
mark_reachable_blocks (unreachable_blocks, bb);
@@ -2715,7 +2721,7 @@ dse_transfer_function (int bb_index)
/* Solve the dataflow equations. */
static void
-step4 (void)
+dse_step4 (void)
{
df_simple_dataflow (DF_BACKWARD, NULL, dse_confluence_0,
dse_confluence_n, dse_transfer_function,
@@ -2761,7 +2767,7 @@ step4 (void)
static void
-step5_nospill (void)
+dse_step5_nospill (void)
{
basic_block bb;
FOR_EACH_BB (bb)
@@ -2859,7 +2865,7 @@ step5_nospill (void)
static void
-step5_spill (void)
+dse_step5_spill (void)
{
basic_block bb;
FOR_EACH_BB (bb)
@@ -2932,7 +2938,7 @@ step5_spill (void)
----------------------------------------------------------------------------*/
static void
-step6 (bool global_done)
+dse_step6 (bool global_done)
{
unsigned int i;
group_info_t group;
@@ -3013,19 +3019,19 @@ rest_of_handle_dse (void)
df_set_flags (DF_DEFER_INSN_RESCAN);
- step0 ();
- step1 ();
- step2_init ();
- if (step2_nospill ())
+ dse_step0 ();
+ dse_step1 ();
+ dse_step2_init ();
+ if (dse_step2_nospill ())
{
df_set_flags (DF_LR_RUN_DCE);
df_analyze ();
did_global = true;
if (dump_file)
fprintf (dump_file, "doing global processing\n");
- step3 (false);
- step4 ();
- step5_nospill ();
+ dse_step3 (false);
+ dse_step4 ();
+ dse_step5_nospill ();
}
/* For the instance of dse that runs after reload, we make a special
@@ -3033,7 +3039,7 @@ rest_of_handle_dse (void)
totally transparent, i.e, there is no aliasing issues that need
to be considered. This means that the wild reads that kill
everything else do not apply here. */
- if (clear_alias_sets && step2_spill ())
+ if (clear_alias_sets && dse_step2_spill ())
{
if (!did_global)
{
@@ -3043,12 +3049,12 @@ rest_of_handle_dse (void)
did_global = true;
if (dump_file)
fprintf (dump_file, "doing global spill processing\n");
- step3 (true);
- step4 ();
- step5_spill ();
+ dse_step3 (true);
+ dse_step4 ();
+ dse_step5_spill ();
}
- step6 (did_global);
+ dse_step6 (did_global);
if (dump_file)
fprintf (dump_file, "dse: local deletions = %d, global deletions = %d, spill deletions = %d\n",
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 92b330eaa49..523e65c47b0 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2237,11 +2237,7 @@ verify_rtx_sharing (rtx orig, rtx insn)
break;
case CONST:
- /* CONST can be shared if it contains a SYMBOL_REF. If it contains
- a LABEL_REF, it isn't sharable. */
- if (GET_CODE (XEXP (x, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
- && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
+ if (shared_const_p (orig))
return;
break;
@@ -2432,11 +2428,7 @@ repeat:
break;
case CONST:
- /* CONST can be shared if it contains a SYMBOL_REF. If it contains
- a LABEL_REF, it isn't sharable. */
- if (GET_CODE (XEXP (x, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
- && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
+ if (shared_const_p (x))
return;
break;
@@ -4839,11 +4831,7 @@ copy_insn_1 (rtx orig)
break;
case CONST:
- /* CONST can be shared if it contains a SYMBOL_REF. If it contains
- a LABEL_REF, it isn't sharable. */
- if (GET_CODE (XEXP (orig, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (orig, 0), 0)) == SYMBOL_REF
- && GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT)
+ if (shared_const_p (orig))
return orig;
break;
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 71bd3ae87cc..9bdd06aea15 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -206,6 +206,21 @@ rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL)
}
+/* Return true if ORIG is a sharable CONST. */
+
+bool
+shared_const_p (rtx orig)
+{
+ gcc_assert (GET_CODE (orig) == CONST);
+
+ /* CONST can be shared if it contains a SYMBOL_REF. If it contains
+ a LABEL_REF, it isn't sharable. */
+ return (GET_CODE (XEXP (orig, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (orig, 0), 0)) == SYMBOL_REF
+ && GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT);
+}
+
+
/* Create a new copy of an rtx.
Recursively copies the operands of the rtx,
except for those few rtx codes that are sharable. */
@@ -239,11 +254,7 @@ copy_rtx (rtx orig)
break;
case CONST:
- /* CONST can be shared if it contains a SYMBOL_REF. If it contains
- a LABEL_REF, it isn't sharable. */
- if (GET_CODE (XEXP (orig, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (orig, 0), 0)) == SYMBOL_REF
- && GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT)
+ if (shared_const_p (orig))
return orig;
break;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 779c927180e..bad157ca71f 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1463,6 +1463,7 @@ extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL);
#define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO)
extern rtvec rtvec_alloc (int);
+extern bool shared_const_p (rtx);
extern rtx copy_rtx (rtx);
extern void dump_rtx_statistics (void);