This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tuples][patch] Converting several easy passes
It turns out that the comparison Diego pointed out "gimple_code (stmt)
!= GIMPLE_CALL" was a typo that caused the pass to basically not run.
However with Diego's fix, it did run and broke many test cases. After
some debugging and great help from Bill Maddox, we concluded that the
pass_simple_dse should not be run yet, as gimple loaded_syms are not
prepared yet.
Thus this patch disables the simple_dse from passes.c and #if 0's the
code itself.
Committing, as partial reversion of my previous patch.
2008-03-04 Oleg Ryjkov <olegr@google.com>
* tree-ssa-dse.c (execute_simple_dse): Commented out.
* passes.c (init_optimization_passes): Disabling pass_simple_dse.
Index: tree-ssa-dse.c
===================================================================
--- tree-ssa-dse.c (revision 132886)
+++ tree-ssa-dse.c (working copy)
@@ -663,6 +663,7 @@ struct tree_opt_pass pass_dse = {
static unsigned int
execute_simple_dse (void)
{
+#if 0
gimple_stmt_iterator gsi;
basic_block bb;
bitmap variables_loaded = BITMAP_ALLOC (NULL);
@@ -672,6 +673,7 @@ execute_simple_dse (void)
body. */
FOR_EACH_BB (bb)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+
if (gimple_loaded_syms (gsi_stmt (gsi)))
bitmap_ior_into (variables_loaded,
gimple_loaded_syms (gsi_stmt (gsi)));
@@ -687,8 +689,10 @@ execute_simple_dse (void)
bool removed = false;
ssa_op_iter iter;
- if (gimple_stored_syms (stmt) && (gimple_code (stmt) == GIMPLE_ASSIGN
- || gimple_code (stmt) != GIMPLE_RETURN)
+ if (gimple_stored_syms (stmt)
+ && (gimple_code (stmt) == GIMPLE_ASSIGN
+ || (gimple_code (stmt) == GIMPLE_CALL
+ && gimple_call_lhs (stmt)))
&& !bitmap_intersect_p (gimple_stored_syms (stmt), variables_loaded))
{
unsigned int i;
@@ -730,11 +734,12 @@ execute_simple_dse (void)
&& TREE_THIS_VOLATILE (gimple_assign_rhs1 (stmt)))
dead = false;
- if (dead && gimple_code (stmt) == GIMPLE_CALL)
+ if (dead)
{
/* When LHS of var = call (); is dead, simplify it into
call (); saving one operand. */
- if (gimple_has_side_effects (stmt))
+ if (gimple_code (stmt) == GIMPLE_CALL
+ && gimple_has_side_effects (stmt))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -766,6 +771,7 @@ execute_simple_dse (void)
}
BITMAP_FREE (variables_loaded);
return todo;
+#endif
}
struct tree_opt_pass pass_simple_dse =
Index: ChangeLog.tuples
===================================================================
--- ChangeLog.tuples (revision 132886)
+++ ChangeLog.tuples (working copy)
@@ -1,5 +1,10 @@
2008-03-04 Oleg Ryjkov <olegr@google.com>
+ * tree-ssa-dse.c (execute_simple_dse): Commented out.
+ * passes.c (init_optimization_passes): Disabling pass_simple_dse.
+
+2008-03-04 Oleg Ryjkov <olegr@google.com>
+
* tree-ssa-dse.c (execute_simple_dse): Tuplified.
* gimplify.c (gimplify_return_expr): Copy the NO_WARNING flag
to the newly created expr from the tree.
Index: passes.c
===================================================================
--- passes.c (revision 132886)
+++ passes.c (working copy)
@@ -537,9 +537,9 @@ init_optimization_passes (void)
NEXT_PASS (pass_forwprop);
#endif
NEXT_PASS (pass_update_address_taken);
- NEXT_PASS (pass_simple_dse);
/* FIXME tuples. */
#if 0
+ NEXT_PASS (pass_simple_dse);
NEXT_PASS (pass_sra_early);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi);