public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [tuples][patch] Removing gimplify_val
@ 2008-03-14  0:04 Oleg Ryjkov
  2008-03-14  0:16 ` Diego Novillo
  2008-03-14  9:48 ` Richard Guenther
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg Ryjkov @ 2008-03-14  0:04 UTC (permalink / raw)
  To: gcc-patches; +Cc: Diego Novillo

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

Hi all,
This patch removes gimplify_val and updates the callers, since it
basically duplicates what is done by force_gimple_operands_gsi, which
in turn is more general and used way more often.
Tested on i686-linux - no new failures, 1 testcase fixed.
Diego, OK to commit?

Oleg

2008-03-13  Oleg Ryjkov  <olegr@google.com>

        * tree-cfg.c (gimplify_val): Removed.
        (gimplify_build1, gimplify_build2, gimplify_build3): Use
        force_gimple_operand_gsi instead of gimplify_val.
        * tree-complex.c (extract_component): Use force_gimple_operand_gsi
        instead of gimplify_val.
        * tree-vect-generic.c (expand_vector_parallel): Ditto.

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

Index: tree-complex.c
===================================================================
--- tree-complex.c	(revision 133191)
+++ tree-complex.c	(working copy)
@@ -595,7 +595,8 @@ extract_component (gimple_stmt_iterator 
 		    inner_type, unshare_expr (t));
 
 	if (gimple_p)
-	  t = gimplify_val (gsi, inner_type, t);
+	  t = force_gimple_operand_gsi (gsi, t, true, NULL, true,
+                                        GSI_SAME_STMT);
 
 	return t;
       }
Index: ChangeLog.tuples
===================================================================
--- ChangeLog.tuples	(revision 133194)
+++ ChangeLog.tuples	(working copy)
@@ -1,3 +1,12 @@
+2008-03-13  Oleg Ryjkov  <olegr@google.com>
+
+	* tree-cfg.c (gimplify_val): Removed.
+	(gimplify_build1, gimplify_build2, gimplify_build3): Use
+	force_gimple_operand_gsi instead of gimplify_val.
+	* tree-complex.c (extract_component): Use force_gimple_operand_gsi
+	instead of gimplify_val.
+	* tree-vect-generic.c (expand_vector_parallel): Ditto.
+
 2008-03-13  Diego Novillo  <dnovillo@google.com>
 	    Oleg Ryjkov  <olegr@google.com>
 
Index: tree-vect-generic.c
===================================================================
--- tree-vect-generic.c	(revision 133191)
+++ tree-vect-generic.c	(working copy)
@@ -248,7 +248,8 @@ expand_vector_parallel (gimple_stmt_iter
       result = expand_vector_piecewise (gsi, f,
 				        word_type, TREE_TYPE (word_type),
 					a, b, code);
-      result = gimplify_val (gsi, word_type, result);
+      result = force_gimple_operand_gsi (gsi, result, true, NULL, true,
+                                         GSI_SAME_STMT);
     }
   else
     {
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 133191)
+++ tree-cfg.c	(working copy)
@@ -6630,37 +6630,6 @@ struct tree_opt_pass pass_split_crit_edg
   0                              /* letter */
 };
 
-\f
-/* Return EXP if it is a valid GIMPLE rvalue, else gimplify it into
-   a temporary, make sure and register it to be renamed if necessary,
-   and finally return the temporary.  Put the statements to compute
-   EXP before the current statement in GSI.  */
-
-tree
-gimplify_val (gimple_stmt_iterator *gsi, tree type, tree exp)
-{
-  tree t;
-  gimple new_stmt, orig_stmt;
-
-  if (is_gimple_val (exp))
-    return exp;
-
-  gcc_assert (is_gimple_formal_tmp_rhs (exp));
-
-  t = make_rename_temp (type, NULL);
-  new_stmt = gimple_build_assign (t, exp);
-
-  orig_stmt = gsi_stmt (*gsi);
-  gimple_set_location (new_stmt, gimple_location (orig_stmt));
-  gimple_set_block (new_stmt, gimple_block (orig_stmt));
-
-  gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
-  if (gimple_in_ssa_p (cfun))
-    mark_symbols_for_renaming (new_stmt);
-
-  return t;
-}
-
 
 /* Build a ternary operation and gimplify it.  Emit code before GSI.
    Return the gimple_val holding the result.  */
@@ -6674,7 +6643,8 @@ gimplify_build3 (gimple_stmt_iterator *g
   ret = fold_build3 (code, type, a, b, c);
   STRIP_NOPS (ret);
 
-  return gimplify_val (gsi, type, ret);
+  return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
+                                   GSI_SAME_STMT);
 }
 
 /* Build a binary operation and gimplify it.  Emit code before GSI.
@@ -6689,7 +6659,8 @@ gimplify_build2 (gimple_stmt_iterator *g
   ret = fold_build2 (code, type, a, b);
   STRIP_NOPS (ret);
 
-  return gimplify_val (gsi, type, ret);
+  return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
+                                   GSI_SAME_STMT);
 }
 
 /* Build a unary operation and gimplify it.  Emit code before GSI.
@@ -6704,7 +6675,8 @@ gimplify_build1 (gimple_stmt_iterator *g
   ret = fold_build1 (code, type, a);
   STRIP_NOPS (ret);
 
-  return gimplify_val (gsi, type, ret);
+  return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
+                                   GSI_SAME_STMT);
 }
 
 

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

* Re: [tuples][patch] Removing gimplify_val
  2008-03-14  0:04 [tuples][patch] Removing gimplify_val Oleg Ryjkov
@ 2008-03-14  0:16 ` Diego Novillo
  2008-03-14  9:48 ` Richard Guenther
  1 sibling, 0 replies; 7+ messages in thread
From: Diego Novillo @ 2008-03-14  0:16 UTC (permalink / raw)
  To: Oleg Ryjkov; +Cc: gcc-patches

On Thu, Mar 13, 2008 at 16:59, Oleg Ryjkov <olegr@google.com> wrote:

>         * tree-cfg.c (gimplify_val): Removed.
>         (gimplify_build1, gimplify_build2, gimplify_build3): Use
>         force_gimple_operand_gsi instead of gimplify_val.
>         * tree-complex.c (extract_component): Use force_gimple_operand_gsi
>         instead of gimplify_val.
>         * tree-vect-generic.c (expand_vector_parallel): Ditto.

OK.


Diego.

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

* Re: [tuples][patch] Removing gimplify_val
  2008-03-14  0:04 [tuples][patch] Removing gimplify_val Oleg Ryjkov
  2008-03-14  0:16 ` Diego Novillo
@ 2008-03-14  9:48 ` Richard Guenther
  2008-03-14 10:07   ` Paolo Bonzini
  2008-03-14 14:21   ` Diego Novillo
  1 sibling, 2 replies; 7+ messages in thread
From: Richard Guenther @ 2008-03-14  9:48 UTC (permalink / raw)
  To: Oleg Ryjkov; +Cc: gcc-patches, Diego Novillo

On Fri, Mar 14, 2008 at 12:59 AM, Oleg Ryjkov <olegr@google.com> wrote:
> Hi all,
>  This patch removes gimplify_val and updates the callers, since it
>  basically duplicates what is done by force_gimple_operands_gsi, which
>  in turn is more general and used way more often.
>  Tested on i686-linux - no new failures, 1 testcase fixed.
>  Diego, OK to commit?

Can you do so on the trunk as well?  The only difference I see with
the two functions is that gimplify_val sets location information on
the new stmt - you may want to do some digging in the archives
for what reason this went in and eventually update force_gimple_operand_bsi
to do so as well.

Thanks,
Richard.

>  Oleg
>
>  2008-03-13  Oleg Ryjkov  <olegr@google.com>
>
>         * tree-cfg.c (gimplify_val): Removed.
>         (gimplify_build1, gimplify_build2, gimplify_build3): Use
>         force_gimple_operand_gsi instead of gimplify_val.
>         * tree-complex.c (extract_component): Use force_gimple_operand_gsi
>         instead of gimplify_val.
>         * tree-vect-generic.c (expand_vector_parallel): Ditto.
>

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

* Re: [tuples][patch] Removing gimplify_val
  2008-03-14  9:48 ` Richard Guenther
@ 2008-03-14 10:07   ` Paolo Bonzini
  2008-03-14 14:21   ` Diego Novillo
  1 sibling, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2008-03-14 10:07 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Oleg Ryjkov, gcc-patches, Diego Novillo


>>  This patch removes gimplify_val and updates the callers, since it
>>  basically duplicates what is done by force_gimple_operands_gsi, which
>>  in turn is more general and used way more often.
>>  Tested on i686-linux - no new failures, 1 testcase fixed.
>>  Diego, OK to commit?
> 
> Can you do so on the trunk as well?  The only difference I see with
> the two functions is that gimplify_val sets location information on
> the new stmt - you may want to do some digging in the archives
> for what reason this went in and eventually update force_gimple_operand_bsi
> to do so as well.

It was there since the beginning.  Since gimplify_val is used in complex 
lowering, and the original complex-type instructions are deleted, 
locations were added to keep debuggability at -O0.

Paolo

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

* Re: [tuples][patch] Removing gimplify_val
  2008-03-14  9:48 ` Richard Guenther
  2008-03-14 10:07   ` Paolo Bonzini
@ 2008-03-14 14:21   ` Diego Novillo
  2008-03-14 14:31     ` Richard Guenther
  1 sibling, 1 reply; 7+ messages in thread
From: Diego Novillo @ 2008-03-14 14:21 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Oleg Ryjkov, gcc-patches

On 3/14/08 2:37 AM, Richard Guenther wrote:

> Can you do so on the trunk as well?  The only difference I see with
> the two functions is that gimplify_val sets location information on
> the new stmt - you may want to do some digging in the archives
> for what reason this went in and eventually update force_gimple_operand_bsi
> to do so as well.

Good idea.  Oleg, please submit this patch for mainline.  Make 
force_gimple_operand_gsi set the location of all the statements in STMTS 
in the loop that scans for symbols to rename.


Diego.

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

* Re: [tuples][patch] Removing gimplify_val
  2008-03-14 14:21   ` Diego Novillo
@ 2008-03-14 14:31     ` Richard Guenther
  2008-03-14 17:36       ` Oleg Ryjkov
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Guenther @ 2008-03-14 14:31 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Oleg Ryjkov, gcc-patches

On Fri, Mar 14, 2008 at 3:20 PM, Diego Novillo <dnovillo@google.com> wrote:
> On 3/14/08 2:37 AM, Richard Guenther wrote:
>
>  > Can you do so on the trunk as well?  The only difference I see with
>  > the two functions is that gimplify_val sets location information on
>  > the new stmt - you may want to do some digging in the archives
>  > for what reason this went in and eventually update force_gimple_operand_bsi
>  > to do so as well.
>
>  Good idea.  Oleg, please submit this patch for mainline.  Make
>  force_gimple_operand_gsi set the location of all the statements in STMTS
>  in the loop that scans for symbols to rename.

There's also the related cleanup (that was posted for 4.3 but taken out again -
I don't remember by whom) of moving the symbol renaming stuff from
force_gimple_operand_bsi to force_gimple_operand to have their
behavior consistent in thsi regard.

Richard.

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

* Re: [tuples][patch] Removing gimplify_val
  2008-03-14 14:31     ` Richard Guenther
@ 2008-03-14 17:36       ` Oleg Ryjkov
  0 siblings, 0 replies; 7+ messages in thread
From: Oleg Ryjkov @ 2008-03-14 17:36 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Diego Novillo, gcc-patches

Oh, thanks for the suggestion - I'll work on moving this into the
mainline as well.

Oleg

On Fri, Mar 14, 2008 at 7:24 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
>
> On Fri, Mar 14, 2008 at 3:20 PM, Diego Novillo <dnovillo@google.com> wrote:
>  > On 3/14/08 2:37 AM, Richard Guenther wrote:
>  >
>  >  > Can you do so on the trunk as well?  The only difference I see with
>  >  > the two functions is that gimplify_val sets location information on
>  >  > the new stmt - you may want to do some digging in the archives
>  >  > for what reason this went in and eventually update force_gimple_operand_bsi
>  >  > to do so as well.
>  >
>  >  Good idea.  Oleg, please submit this patch for mainline.  Make
>  >  force_gimple_operand_gsi set the location of all the statements in STMTS
>  >  in the loop that scans for symbols to rename.
>
>  There's also the related cleanup (that was posted for 4.3 but taken out again -
>  I don't remember by whom) of moving the symbol renaming stuff from
>  force_gimple_operand_bsi to force_gimple_operand to have their
>  behavior consistent in thsi regard.
>
>  Richard.
>

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14  0:04 [tuples][patch] Removing gimplify_val Oleg Ryjkov
2008-03-14  0:16 ` Diego Novillo
2008-03-14  9:48 ` Richard Guenther
2008-03-14 10:07   ` Paolo Bonzini
2008-03-14 14:21   ` Diego Novillo
2008-03-14 14:31     ` Richard Guenther
2008-03-14 17:36       ` Oleg Ryjkov

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