This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Minor cleanups from PRE discussion
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Feb 2004 23:27:18 -0700
- Subject: [tree-ssa] Minor cleanups from PRE discussion
- Reply-to: law at redhat dot com
These don't actually fix the issue at hand, they're merely cleanups
spurred by the lengthy PRE discussion from earlier today.
There is a _slight_ possibility that we could see some code improvements
as this change allows more propagation of virtual operands. However, I
don't really expect any noticeable change.
Bootstrapped and regression tested i686-pc-linux-gnu.
* tree-flow-inline.h (may_propagate_copy): Do not perform ABNORMAL_PHI
and DECL_HARD_REGISTER tests on virtual operands.
* tree-flow.h (propagate_copy): Kill prototype.
(propagate_value): New prototype.
* tree-ssa-dom.c (propagate_copy): Now static.
(propagate_value): No longer static.
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.66
diff -c -p -r1.1.2.66 tree-flow-inline.h
*** tree-flow-inline.h 10 Feb 2004 18:24:16 -0000 1.1.2.66
--- tree-flow-inline.h 21 Feb 2004 06:22:10 -0000
*************** may_propagate_copy (tree dest, tree orig
*** 438,443 ****
--- 438,448 ----
return false;
}
+ /* We do not care about abnormal PHIs or user specified register
+ declarations for virtual operands. */
+ if (! is_gimple_reg (dest))
+ return true;
+
return (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI (dest)
&& (TREE_CODE (orig) != SSA_NAME
|| !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig))
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.191
diff -c -p -r1.1.4.191 tree-flow.h
*** tree-flow.h 20 Feb 2004 12:46:00 -0000 1.1.4.191
--- tree-flow.h 21 Feb 2004 06:22:11 -0000
*************** tree widen_bitfield (tree, tree, tree);
*** 576,582 ****
/* In tree-ssa-dom.c */
extern void dump_dominator_optimization_stats (FILE *);
extern void debug_dominator_optimization_stats (void);
! extern void propagate_copy (tree *, tree);
/* In tree-flow-inline.h */
static inline int phi_arg_from_edge (tree, edge);
--- 576,582 ----
/* In tree-ssa-dom.c */
extern void dump_dominator_optimization_stats (FILE *);
extern void debug_dominator_optimization_stats (void);
! extern void propagate_value (tree *, tree);
/* In tree-flow-inline.h */
static inline int phi_arg_from_edge (tree, edge);
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.136
diff -c -p -r1.1.2.136 tree-ssa-dom.c
*** tree-ssa-dom.c 16 Feb 2004 12:36:01 -0000 1.1.2.136
--- tree-ssa-dom.c 21 Feb 2004 06:22:19 -0000
*************** static void restore_vars_to_original_val
*** 259,264 ****
--- 259,265 ----
varray_type table);
static void register_definitions_for_stmt (tree, varray_type *);
static void redirect_edges_and_update_ssa_graph (varray_type);
+ static void propagate_copy (tree *, tree);
/* Local version of fold that doesn't introduce cruft. */
*************** local_fold (tree t)
*** 279,285 ****
/* Propagate the value VAL (assumed to be a constant or another SSA_NAME)
into the operand pointed by OP_P. */
! static void
propagate_value (tree *op_p, tree val)
{
if (TREE_CODE (val) == SSA_NAME)
--- 280,286 ----
/* Propagate the value VAL (assumed to be a constant or another SSA_NAME)
into the operand pointed by OP_P. */
! void
propagate_value (tree *op_p, tree val)
{
if (TREE_CODE (val) == SSA_NAME)
*************** avail_expr_eq (const void *p1, const voi
*** 3314,3320 ****
pointer, copy the memory tag used originally by *OP_P into VAR. This is
needed in cases where VAR had never been dereferenced in the program. */
! void
propagate_copy (tree *op_p, tree var)
{
#if defined ENABLE_CHECKING
--- 3315,3321 ----
pointer, copy the memory tag used originally by *OP_P into VAR. This is
needed in cases where VAR had never been dereferenced in the program. */
! static void
propagate_copy (tree *op_p, tree var)
{
#if defined ENABLE_CHECKING