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]

[PATCH]: Make lambda-code use ssa iterators


This is another in a series of small, simple, cleanup patches for lamba-code.c

The others are unreviewed, and at
http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02711.html
and
http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02943.html

This patch simply converts a walk through STMT_USE_OPS to use the FOR_EACH_SSA_USE_OPERAND iterator, and calls propagate_value
instead of SET_USE to do replacement.


Bootstrapped and regtested i686-pc-linux-gnu.
Okay for mainline?

2004-10-06 Daniel Berlin <dberlin@dberlin.org>

	* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Convert
	to use FOR_EACH_SSA_USE_OPERAND iterator, and propagate_value.

Index: lambda-code.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda-code.c,v
retrieving revision 2.12
diff -u -p -r2.12 lambda-code.c
--- lambda-code.c	28 Sep 2004 07:59:47 -0000	2.12
+++ lambda-code.c	6 Oct 2004 16:08:11 -0000
@@ -1898,15 +1921,12 @@ lambda_loopnest_to_gcc_loopnest (struct
       dataflow_t imm = get_immediate_uses (SSA_NAME_DEF_STMT (oldiv));
       for (j = 0; j < num_immediate_uses (imm); j++)
 	{
-	  size_t k;
 	  tree stmt = immediate_use (imm, j);
-	  use_optype uses;
-	  get_stmt_operands (stmt);
-	  uses = STMT_USE_OPS (stmt);
-	  for (k = 0; k < NUM_USES (uses); k++)
+	  use_operand_p use_p;
+	  ssa_op_iter iter;
+	  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
 	    {
-	      use_operand_p use = USE_OP_PTR (uses, k);
-	      if (USE_FROM_PTR (use) == oldiv)
+	      if (USE_FROM_PTR (use_p) == oldiv)
 		{
 		  tree newiv, stmts;
 		  lambda_body_vector lbv;
@@ -1921,7 +1941,7 @@ lambda_loopnest_to_gcc_loopnest (struct
 		  /* Insert the statements to build that
 		     expression.  */
 		  bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
-		  SET_USE (use, newiv);
+		  propagate_value (use_p, newiv);
 		  modify_stmt (stmt);

}


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