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

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