This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Graphite middle-end parts review


On Wed, Aug 13, 2008 at 4:07 PM, Richard Guenther <rguenther@suse.de> wrote:
>> No, Jan did the right thing here.  I also think that we should have
>> more systematic functions that take care of everything: creating the
>> variable, etc.
>
> Right.  Whoever creates the variable should add it.  In this
> place you either have created iv without using it in some cases
> or my suggestion is correct.  So - I don't agree with you.

Okay, then why isn't add_referenced_var part of create_tmp_var?  I
don't like the separation of these two functions, but here is what I
committed to the graphite branch.

2008-08-13  Sebastian Pop  <sebastian.pop@amd.com>

	* cfgloopmanip.c (create_empty_loop_on_edge): Don't call
	add_referenced_var.
	* graphite.c (graphite_create_new_loop): Call add_referenced_var.

Index: cfgloopmanip.c
===================================================================
--- cfgloopmanip.c	(revision 139073)
+++ cfgloopmanip.c	(working copy)
@@ -592,7 +592,6 @@ create_empty_loop_on_edge (edge entry_ed
       gsi_commit_edge_inserts ();
     }

-  add_referenced_var (iv);
   standard_iv_increment_position (loop, &gsi, &insert_after);
   create_iv (initial_value, stride, iv, loop, &gsi, insert_after,
 	     iv_before, NULL);
Index: graphite.c
===================================================================
--- graphite.c	(revision 139047)
+++ graphite.c	(working copy)
@@ -3140,6 +3140,8 @@ graphite_create_new_loop (scop_p scop, e
 				  SCOP_PARAMS (scop),
 				  ivstack);
   ivvar = create_tmp_var (integer_type_node, "graphiteIV");
+  add_referenced_var (ivvar);
+
   upb = clast_to_gcc_expression (stmt->UB, integer_type_node,
 				 SCOP_PARAMS (scop),
 				 ivstack);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]