This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor speedup and cleanup for out-of-ssa pass
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 May 2004 23:04:28 -0600
- Subject: Minor speedup and cleanup for out-of-ssa pass
- Reply-to: law at redhat dot com
It's pointless for the out-of-ssa pass to compute local/global life
information for virtual variables. It's also rather silly to use
DEF_OP_PTR and dereference the result when just using DEF_OP is
sufficient (similarly for USE_OP_PTR/USE_OP).
Bootstrapped and regression tested on i686-pc-linux-gnu.
* tree-ssa-live.c (calculate_live_on_entry): Ignore virtual
variables. Simplify slightly by using USE_OP/DEF_OP instead
of USE_OP_PTR/DEF_OP_PTR and dereferencing the result.
Index: tree-ssa-live.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-live.c,v
retrieving revision 2.1
diff -c -p -r2.1 tree-ssa-live.c
*** tree-ssa-live.c 13 May 2004 06:39:49 -0000 2.1
--- tree-ssa-live.c 14 May 2004 04:58:37 -0000
*************** calculate_live_on_entry (var_map map)
*** 551,562 ****
basic_block bb;
bitmap saw_def;
tree phi, var, stmt;
! tree *vec;
edge e;
varray_type stack;
block_stmt_iterator bsi;
- vuse_optype vuses;
- vdef_optype vdefs;
use_optype uses;
def_optype defs;
stmt_ann_t ann;
--- 551,560 ----
basic_block bb;
bitmap saw_def;
tree phi, var, stmt;
! tree op;
edge e;
varray_type stack;
block_stmt_iterator bsi;
use_optype uses;
def_optype defs;
stmt_ann_t ann;
*************** calculate_live_on_entry (var_map map)
*** 610,648 ****
num = NUM_USES (uses);
for (i = 0; i < num; i++)
{
! vec = USE_OP_PTR (uses, i);
! add_livein_if_notdef (live, saw_def, *vec, bb);
! }
!
! vuses = VUSE_OPS (ann);
! num = NUM_VUSES (vuses);
! for (i = 0; i < num; i++)
! {
! var = VUSE_OP (vuses, i);
! add_livein_if_notdef (live, saw_def, var, bb);
! }
!
! vdefs = VDEF_OPS (ann);
! num = NUM_VDEFS (vdefs);
! for (i = 0; i < num; i++)
! {
! var = VDEF_OP (vdefs, i);
! add_livein_if_notdef (live, saw_def, var, bb);
}
defs = DEF_OPS (ann);
num = NUM_DEFS (defs);
for (i = 0; i < num; i++)
{
! vec = DEF_OP_PTR (defs, i);
! set_if_valid (map, saw_def, *vec);
! }
!
! num = NUM_VDEFS (vdefs);
! for (i = 0; i < num; i++)
! {
! var = VDEF_RESULT (vdefs, i);
! set_if_valid (map, saw_def, var);
}
}
}
--- 608,623 ----
num = NUM_USES (uses);
for (i = 0; i < num; i++)
{
! op = USE_OP (uses, i);
! add_livein_if_notdef (live, saw_def, op, bb);
}
defs = DEF_OPS (ann);
num = NUM_DEFS (defs);
for (i = 0; i < num; i++)
{
! op = DEF_OP (defs, i);
! set_if_valid (map, saw_def, op);
}
}
}