public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [tuples][patch] Converting several easy passes
@ 2008-03-04 22:19 Oleg Ryjkov
  2008-03-05  0:12 ` Diego Novillo
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Ryjkov @ 2008-03-04 22:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: dnovillo

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

This patch enables pass_warn_function_return, pass_update_address_taken,
pass_simple_dse and pass_build_alias passes; also fixes the copying of the
NO_WARNING flag to a newly created gimple_return. Tested yesterday, with
couple of tests being fixed. I'm running the testsuite with the most
up-to-date codebase.
OK, provided that nothing new breaks?

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.
  * tree-cfg.c (gimplify_build1): Tuplified.
  * passes.c (init_optimization_passes): Enabled
  pass_warn_function_return, pass_update_address_taken,
  pass_simple_dse and pass_build_alias passes.

[-- Attachment #2: 1.diff --]
[-- Type: text/plain, Size: 9486 bytes --]

Index: tree-ssa-dse.c
===================================================================
--- tree-ssa-dse.c	(revision 132872)
+++ tree-ssa-dse.c	(working copy)
@@ -663,9 +663,7 @@ struct tree_opt_pass pass_dse = {
 static unsigned int
 execute_simple_dse (void)
 {
-  /* FIXME tuples.  */
-#if 0
-  block_stmt_iterator bsi;
+  gimple_stmt_iterator gsi;
   basic_block bb;
   bitmap variables_loaded = BITMAP_ALLOC (NULL);
   unsigned int todo = 0;
@@ -673,24 +671,25 @@ execute_simple_dse (void)
   /* Collect into VARIABLES LOADED all variables that are read in function
      body.  */
   FOR_EACH_BB (bb)
-    for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
-      if (LOADED_SYMS (bsi_stmt (bsi)))
+    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,
-			 LOADED_SYMS (bsi_stmt (bsi)));
+			 gimple_loaded_syms (gsi_stmt (gsi)));
 
   /* Look for statements writing into the write only variables.
      And try to remove them.  */
 
   FOR_EACH_BB (bb)
-    for (bsi = bsi_start (bb); !bsi_end_p (bsi);)
+    for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
       {
-	tree stmt = bsi_stmt (bsi), op;
+	gimple stmt = gsi_stmt (gsi);
+        tree op;
 	bool removed = false;
         ssa_op_iter iter;
 
-	if (STORED_SYMS (stmt) && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
-	    && TREE_CODE (stmt) != RETURN_EXPR
-	    && !bitmap_intersect_p (STORED_SYMS (stmt), variables_loaded))
+	if (gimple_stored_syms (stmt) && (gimple_code (stmt) == GIMPLE_ASSIGN
+	    || gimple_code (stmt) != GIMPLE_CALL)
+	    && !bitmap_intersect_p (gimple_stored_syms (stmt), variables_loaded))
 	  {
 	    unsigned int i;
 	    bitmap_iterator bi;
@@ -705,7 +704,7 @@ execute_simple_dse (void)
 	       from removing them as dead.  The flag thus has no use for us
 	       and we need to look into all operands.  */
 	      
-	    EXECUTE_IF_SET_IN_BITMAP (STORED_SYMS (stmt), 0, i, bi)
+	    EXECUTE_IF_SET_IN_BITMAP (gimple_stored_syms (stmt), 0, i, bi)
 	      {
 		tree var = referenced_var_lookup (i);
 		if (TREE_ADDRESSABLE (var)
@@ -714,8 +713,8 @@ execute_simple_dse (void)
 		  dead = false;
 	      }
 
-	    if (dead && LOADED_SYMS (stmt))
-	      EXECUTE_IF_SET_IN_BITMAP (LOADED_SYMS (stmt), 0, i, bi)
+	    if (dead && gimple_loaded_syms (stmt))
+	      EXECUTE_IF_SET_IN_BITMAP (gimple_loaded_syms (stmt), 0, i, bi)
 		if (TREE_THIS_VOLATILE (referenced_var_lookup (i)))
 		  dead = false;
 
@@ -727,56 +726,46 @@ execute_simple_dse (void)
 	    /* Look for possible occurence var = indirect_ref (...) where
 	       indirect_ref itself is volatile.  */
 
-	    if (dead && TREE_THIS_VOLATILE (GIMPLE_STMT_OPERAND (stmt, 1)))
+	    if (dead && gimple_code (stmt) == GIMPLE_ASSIGN &&
+                TREE_THIS_VOLATILE (gimple_assign_rhs1 (stmt)))
 	      dead = false;
 
-	    if (dead)
+	    if (dead && gimple_code (stmt) == GIMPLE_CALL)
 	      {
-		tree call = get_call_expr_in (stmt);
-
 		/* When LHS of var = call (); is dead, simplify it into
 		   call (); saving one operand.  */
-		if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
-		    && call
-		    && TREE_SIDE_EFFECTS (call))
+                if (gimple_has_side_effects (stmt))
 		  {
 		    if (dump_file && (dump_flags & TDF_DETAILS))
 		      {
 			fprintf (dump_file, "Deleted LHS of call: ");
-			print_generic_stmt (dump_file, stmt, TDF_SLIM);
+			print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
 			fprintf (dump_file, "\n");
 		      }
-		    push_stmt_changes (bsi_stmt_ptr (bsi));
-		    TREE_BLOCK (call) = TREE_BLOCK (stmt);
-		    bsi_replace (&bsi, call, false);
-		    maybe_clean_or_replace_eh_stmt (stmt, call);
-		    mark_symbols_for_renaming (call);
-		    pop_stmt_changes (bsi_stmt_ptr (bsi));
+		    push_stmt_changes (gsi_stmt_ptr (&gsi));
+                    gimple_call_set_lhs (stmt, NULL);
+		    pop_stmt_changes (gsi_stmt_ptr (&gsi));
 		  }
 		else
 		  {
 		    if (dump_file && (dump_flags & TDF_DETAILS))
 		      {
 			fprintf (dump_file, "  Deleted dead store '");
-			print_generic_expr (dump_file, stmt, dump_flags);
+			print_gimple_stmt (dump_file, stmt, 0, dump_flags);
 			fprintf (dump_file, "'\n");
 		      }
 		    removed = true;
-		    bsi_remove (&bsi, true);
+		    gsi_remove (&gsi, true);
 		    todo |= TODO_cleanup_cfg;
 		  }
 		todo |= TODO_remove_unused_locals | TODO_ggc_collect;
 	      }
 	  }
 	if (!removed)
-	  bsi_next (&bsi);
+	  gsi_next (&gsi);
       }
   BITMAP_FREE (variables_loaded);
   return todo;
-#else
-  gimple_unreachable ();
-  return 0;
-#endif
 }
 
 struct tree_opt_pass pass_simple_dse =
Index: ChangeLog.tuples
===================================================================
--- ChangeLog.tuples	(revision 132872)
+++ ChangeLog.tuples	(working copy)
@@ -1,3 +1,13 @@
+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.
+	* tree-cfg.c (gimplify_build1): Tuplified.
+	* passes.c (init_optimization_passes): Enabled
+	pass_warn_function_return, pass_update_address_taken,
+	pass_simple_dse and pass_build_alias passes.
+
 2008-03-04  Rafael Espindola  <espindola@google.com>
 
 	* fold-const.c (tree_simple_nonnegative_warnv_p): New.
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 132872)
+++ gimplify.c	(working copy)
@@ -1192,6 +1192,7 @@ gimplify_return_expr (tree stmt, gimple_
       || ret_expr == error_mark_node)
     {
       gimple ret = gimple_build_return (ret_expr);
+      gimple_set_no_warning (ret, TREE_NO_WARNING (stmt));
       gimple_seq_add_stmt (pre_p, ret);
       return GS_ALL_DONE;
     }
@@ -1248,7 +1249,9 @@ gimplify_return_expr (tree stmt, gimple_
 
   gimplify_and_add (TREE_OPERAND (stmt, 0), pre_p);
 
-  gimple_seq_add_stmt (pre_p, gimple_build_return (result));
+  gimple ret = gimple_build_return (result);
+  gimple_set_no_warning (ret, TREE_NO_WARNING (stmt));
+  gimple_seq_add_stmt (pre_p, ret);
 
   return GS_ALL_DONE;
 }
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 132872)
+++ tree-cfg.c	(working copy)
@@ -6689,14 +6689,12 @@ gimplify_build1 (gimple_stmt_iterator *g
 static unsigned int
 execute_warn_function_return (void)
 {
-/* FIXME tuples  */
-#if 0
 #ifdef USE_MAPPED_LOCATION
   source_location location;
 #else
   location_t *locus;
 #endif
-  tree last;
+  gimple last;
   edge e;
   edge_iterator ei;
 
@@ -6712,9 +6710,9 @@ execute_warn_function_return (void)
       FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
 	{
 	  last = last_stmt (e->src);
-	  if (TREE_CODE (last) == RETURN_EXPR
+	  if (gimple_code (last) == GIMPLE_RETURN
 #ifdef USE_MAPPED_LOCATION
-	      && (location = EXPR_LOCATION (last)) != UNKNOWN_LOCATION)
+	      && (location = gimple_locus (last)) != UNKNOWN_LOCATION)
 #else
 	      && (locus = EXPR_LOCUS (last)) != NULL)
 #endif
@@ -6740,13 +6738,13 @@ execute_warn_function_return (void)
     {
       FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
 	{
-	  tree last = last_stmt (e->src);
-	  if (TREE_CODE (last) == RETURN_EXPR
-	      && TREE_OPERAND (last, 0) == NULL
-	      && !TREE_NO_WARNING (last))
+	  gimple last = last_stmt (e->src);
+	  if (gimple_code (last) == GIMPLE_RETURN
+	      && gimple_return_retval (last) == NULL
+	      && !gimple_no_warning_p (last))
 	    {
 #ifdef USE_MAPPED_LOCATION
-	      location = EXPR_LOCATION (last);
+	      location = gimple_locus (last);
 	      if (location == UNKNOWN_LOCATION)
 		  location = cfun->function_end_locus;
 	      warning (OPT_Wreturn_type, "%Hcontrol reaches end of non-void function", &location);
@@ -6762,10 +6760,6 @@ execute_warn_function_return (void)
 	}
     }
   return 0;
-#else
-  gimple_unreachable ();
-  return 0;
-#endif
 }
 
 
Index: passes.c
===================================================================
--- passes.c	(revision 132872)
+++ passes.c	(working copy)
@@ -491,10 +491,7 @@ init_optimization_passes (void)
   NEXT_PASS (pass_build_cfg);
   NEXT_PASS (pass_lower_complex_O0);
   NEXT_PASS (pass_lower_vector);
-  /* FIXME tuples.  */
-#if 0
   NEXT_PASS (pass_warn_function_return);
-#endif
   NEXT_PASS (pass_build_cgraph_edges);
   NEXT_PASS (pass_inline_parameters);
   *p = NULL;
@@ -538,13 +535,19 @@ init_optimization_passes (void)
 #if 0
 	  NEXT_PASS (pass_ccp);
 	  NEXT_PASS (pass_forwprop);
+#endif
 	  NEXT_PASS (pass_update_address_taken);
 	  NEXT_PASS (pass_simple_dse);
+/* FIXME tuples.  */
+#if 0
 	  NEXT_PASS (pass_sra_early);
 	  NEXT_PASS (pass_copy_prop);
 	  NEXT_PASS (pass_merge_phi);
 	  NEXT_PASS (pass_dce);
+#endif
 	  NEXT_PASS (pass_update_address_taken);
+/* FIXME tuples.  */
+#if 0
 	  NEXT_PASS (pass_simple_dse);
 	  NEXT_PASS (pass_tail_recursion);
           NEXT_PASS (pass_profile);
@@ -582,12 +585,12 @@ init_optimization_passes (void)
     {
       struct tree_opt_pass **p = &pass_all_optimizations.sub;
       NEXT_PASS (pass_create_structure_vars);
-      /* FIXME tuples.  */
-#if 0
       /* ??? pass_build_alias is a dummy pass that ensures that we
 	 execute TODO_rebuild_alias at this point even if
 	 pass_create_structure_vars was disabled.  */
       NEXT_PASS (pass_build_alias);
+      /* FIXME tuples.  */
+#if 0
       NEXT_PASS (pass_return_slot);
       NEXT_PASS (pass_rename_ssa_copies);
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tuples][patch] Converting several easy passes
  2008-03-04 22:19 [tuples][patch] Converting several easy passes Oleg Ryjkov
@ 2008-03-05  0:12 ` Diego Novillo
  2008-03-05  0:47   ` Oleg Ryjkov
  0 siblings, 1 reply; 7+ messages in thread
From: Diego Novillo @ 2008-03-05  0:12 UTC (permalink / raw)
  To: Oleg Ryjkov; +Cc: gcc-patches

On 3/4/08 5:18 PM, Oleg Ryjkov wrote:

>   * 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.
>   * tree-cfg.c (gimplify_build1): Tuplified.
>   * passes.c (init_optimization_passes): Enabled
>   pass_warn_function_return, pass_update_address_taken,
>   pass_simple_dse and pass_build_alias passes.

OK with some changes.

>  
> -	if (STORED_SYMS (stmt) && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
> -	    && TREE_CODE (stmt) != RETURN_EXPR
> -	    && !bitmap_intersect_p (STORED_SYMS (stmt), variables_loaded))
> +	if (gimple_stored_syms (stmt) && (gimple_code (stmt) == GIMPLE_ASSIGN
> +	    || gimple_code (stmt) != GIMPLE_CALL)
> +	    && !bitmap_intersect_p (gimple_stored_syms (stmt), variables_loaded))

Why the change to gimple_code (stmt) != GIMPLE_RETURN?

> @@ -727,56 +726,46 @@ execute_simple_dse (void)
>  	    /* Look for possible occurence var = indirect_ref (...) where
>  	       indirect_ref itself is volatile.  */
>  
> -	    if (dead && TREE_THIS_VOLATILE (GIMPLE_STMT_OPERAND (stmt, 1)))
> +	    if (dead && gimple_code (stmt) == GIMPLE_ASSIGN &&
> +                TREE_THIS_VOLATILE (gimple_assign_rhs1 (stmt)))

Align vertically.



Diego.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tuples][patch] Converting several easy passes
  2008-03-05  0:12 ` Diego Novillo
@ 2008-03-05  0:47   ` Oleg Ryjkov
  2008-03-05  3:43     ` Oleg Ryjkov
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Ryjkov @ 2008-03-05  0:47 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-patches

Committed wit your changes.

On Tue, Mar 4, 2008 at 3:19 PM, Diego Novillo <dnovillo@google.com> wrote:
> On 3/4/08 5:18 PM, Oleg Ryjkov wrote:
>
>  >   * 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.
>  >   * tree-cfg.c (gimplify_build1): Tuplified.
>  >   * passes.c (init_optimization_passes): Enabled
>  >   pass_warn_function_return, pass_update_address_taken,
>  >   pass_simple_dse and pass_build_alias passes.
>
>  OK with some changes.
>
>  >
>  > -     if (STORED_SYMS (stmt) && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
>  > -         && TREE_CODE (stmt) != RETURN_EXPR
>  > -         && !bitmap_intersect_p (STORED_SYMS (stmt), variables_loaded))
>  > +     if (gimple_stored_syms (stmt) && (gimple_code (stmt) == GIMPLE_ASSIGN
>  > +         || gimple_code (stmt) != GIMPLE_CALL)
>  > +         && !bitmap_intersect_p (gimple_stored_syms (stmt), variables_loaded))
>
>  Why the change to gimple_code (stmt) != GIMPLE_RETURN?
This is a typo.

>
>  > @@ -727,56 +726,46 @@ execute_simple_dse (void)
>  >           /* Look for possible occurence var = indirect_ref (...) where
>  >              indirect_ref itself is volatile.  */
>  >
>  > -         if (dead && TREE_THIS_VOLATILE (GIMPLE_STMT_OPERAND (stmt, 1)))
>  > +         if (dead && gimple_code (stmt) == GIMPLE_ASSIGN &&
>  > +                TREE_THIS_VOLATILE (gimple_assign_rhs1 (stmt)))
>
>  Align vertically.
>
>
>
>  Diego.
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tuples][patch] Converting several easy passes
  2008-03-05  0:47   ` Oleg Ryjkov
@ 2008-03-05  3:43     ` Oleg Ryjkov
  2008-03-05  3:46       ` Diego Novillo
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Ryjkov @ 2008-03-05  3:43 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-patches, Bill Maddox

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix.patch --]
[-- Type: text/x-patch; name=fix.patch, Size: 2891 bytes --]

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);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tuples][patch] Converting several easy passes
  2008-03-05  3:43     ` Oleg Ryjkov
@ 2008-03-05  3:46       ` Diego Novillo
  2008-03-23  0:30         ` Jakub Staszak
  0 siblings, 1 reply; 7+ messages in thread
From: Diego Novillo @ 2008-03-05  3:46 UTC (permalink / raw)
  To: Oleg Ryjkov; +Cc: gcc-patches, Bill Maddox

On 03/04/08 22:43, Oleg Ryjkov wrote:

> pass_simple_dse should not be run yet, as gimple loaded_syms are not
> prepared yet.

They are not?  They should be as they are part of operand scanning and 
alias analysis, which are already operational.

> 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.
> 

Reverting this patch is enough to get the regressions?


Thanks.  Diego.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tuples][patch] Converting several easy passes
  2008-03-05  3:46       ` Diego Novillo
@ 2008-03-23  0:30         ` Jakub Staszak
  2008-03-24 14:25           ` Diego Novillo
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Staszak @ 2008-03-23  0:30 UTC (permalink / raw)
  To: GCC; +Cc: Diego Novillo, Oleg Ryjkov

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

This patch enables pass_simple_dse, which was already tuplified, but  
it was
#if0'ed because it caused huge number of regressions. Tested on Compile
Farm (amd64-linux), no regressions.


   * tree-ssa-dse.c (execute_simple_dse): #if 0 removed,  
bitmap_empty_p condition
   added.
   * passes.c (init_optimization_passes): pass_simple_dse enabled.

-- 
Jakub Staszak

[-- Attachment #2: tuples-simple-dse.patch --]
[-- Type: application/octet-stream, Size: 1449 bytes --]

Index: gcc/tree-ssa-dse.c
===================================================================
--- gcc/tree-ssa-dse.c	(revision 133453)
+++ gcc/tree-ssa-dse.c	(working copy)
@@ -662,7 +662,6 @@
 static unsigned int
 execute_simple_dse (void)
 {
-#if 0
   gimple_stmt_iterator gsi;
   basic_block bb;
   bitmap variables_loaded = BITMAP_ALLOC (NULL);
@@ -689,6 +688,7 @@
         ssa_op_iter iter;
 
 	if (gimple_stored_syms (stmt)
+	    && !bitmap_empty_p (gimple_stored_syms (stmt))
             && (gimple_code (stmt) == GIMPLE_ASSIGN
 	        || (gimple_code (stmt) == GIMPLE_CALL
                     && gimple_call_lhs (stmt)))
@@ -770,7 +770,6 @@
       }
   BITMAP_FREE (variables_loaded);
   return todo;
-#endif
 }
 
 struct tree_opt_pass pass_simple_dse =
Index: gcc/passes.c
===================================================================
--- gcc/passes.c	(revision 133453)
+++ gcc/passes.c	(working copy)
@@ -540,8 +540,8 @@
 #endif
 	  NEXT_PASS (pass_update_address_taken);
 /* FIXME tuples.  */
+	  NEXT_PASS (pass_simple_dse);
 #if 0
-	  NEXT_PASS (pass_simple_dse);
 	  NEXT_PASS (pass_sra_early);
 	  NEXT_PASS (pass_copy_prop);
 	  NEXT_PASS (pass_merge_phi);
@@ -549,8 +549,8 @@
 	  NEXT_PASS (pass_dce);
 	  NEXT_PASS (pass_update_address_taken);
 /* FIXME tuples.  */
+	  NEXT_PASS (pass_simple_dse);
 #if 0
-	  NEXT_PASS (pass_simple_dse);
 	  NEXT_PASS (pass_tail_recursion);
 #endif
           NEXT_PASS (pass_profile);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tuples][patch] Converting several easy passes
  2008-03-23  0:30         ` Jakub Staszak
@ 2008-03-24 14:25           ` Diego Novillo
  0 siblings, 0 replies; 7+ messages in thread
From: Diego Novillo @ 2008-03-24 14:25 UTC (permalink / raw)
  To: Jakub Staszak; +Cc: GCC, Oleg Ryjkov

On 03/22/08 19:02, Jakub Staszak wrote:

>   * tree-ssa-dse.c (execute_simple_dse): #if 0 removed, bitmap_empty_p 
> condition
>   added.
>   * passes.c (init_optimization_passes): pass_simple_dse enabled.
> 

OK.


Diego.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-03-24 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 22:19 [tuples][patch] Converting several easy passes Oleg Ryjkov
2008-03-05  0:12 ` Diego Novillo
2008-03-05  0:47   ` Oleg Ryjkov
2008-03-05  3:43     ` Oleg Ryjkov
2008-03-05  3:46       ` Diego Novillo
2008-03-23  0:30         ` Jakub Staszak
2008-03-24 14:25           ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).