public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix IV-opts so it no longer produces MEM[index:]
@ 2007-08-01  2:36 Andrew_Pinski
  2007-08-01  9:52 ` Zdenek Dvorak
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew_Pinski @ 2007-08-01  2:36 UTC (permalink / raw)
  To: gcc-patches

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

Hi,
  The problem here is that add_candidate_1 is using generic_type_for which 
causes the pointer type be converted over to sizetype and so when we go to 
use that candidate, we create MEM[index:].  This changes that and fixes up 
all the fallout in the testsuite I could find (including two new issues 
which showed up after the summit, I had originally tested it before the 
summit but I decided to test it again before submitting it).  The fall out 
is having tree-affine use sizetype of the steps, fixing up add_to_parts to 
use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers, create_iv use 
sizetype variable for the step for pointer types, and also fixing up parts 
of iv-opts to use sizetype for steps.  The main reason why I am doing this 
is to reduce the memory usage after IV-opts and also so maybe we can rerun 
may_alias after iv-opts and not get confused as much and it is nice to see 
no cast from pointer types to sizetype in the code any more and I think it 
also helps out with the REG_POINTER issue when I get rid of the 
DECL_AFTICIAL clause as we have a real pointer type here now.


OK? Bootstrapped and tested on i686-linux-gnu and powerpc64-linux-gnu with 
no regressions.

Thank,
Andrew Pinski

ChangeLog:

        * tree-ssa-loop-manip.c (create_iv): Use a new temp
        variable for the step with the correct type.
        * tree-ssa-loop-ivopts.c (find_bivs): Convert the step
        to sizetype if type is a pointer type.
        (add_candidate_1): Don't convert the base and step to
        the generic type if the orginal type is a pointer type.
        (add_iv_value_candidates): Use sizetype for the step
        if type is a pointer type.
        (cand_value_at): Likewise.
        * tree-ssa-address.c (add_to_parts): Use POINTER_PLUS_EXPR
        for pointer types.
        * tree-affine.c (tree_to_aff_combination <POINTER_PLUS_EXPR>):
        Don't convert the tem affine to the type.
        (add_elt_to_tree): Use sizetype for the step if a pointer.
        Use POINTER_PLUS_EXPR for pointers.
        (aff_combination_to_tree): Use sizetype for the step if a
        pointer.



[-- Attachment #2: fixupivopts-real.diff.txt --]
[-- Type: text/plain, Size: 6763 bytes --]

Index: tree-ssa-loop-manip.c
===================================================================
--- tree-ssa-loop-manip.c	(revision 127066)
+++ tree-ssa-loop-manip.c	(working copy)
@@ -56,12 +56,15 @@ create_iv (tree base, tree step, tree va
   tree vb, va;
   enum tree_code incr_op = PLUS_EXPR;
   edge pe = loop_preheader_edge (loop);
+  tree var1;
 
   if (!var)
     {
       var = create_tmp_var (TREE_TYPE (base), "ivtmp");
       add_referenced_var (var);
     }
+  var1 = create_tmp_var (TREE_TYPE (step), "ivtmp");
+  add_referenced_var (var1);
 
   vb = make_ssa_name (var, NULL_TREE);
   if (var_before)
@@ -104,7 +107,7 @@ create_iv (tree base, tree step, tree va
     }
   /* Gimplify the step if necessary.  We put the computations in front of the
      loop (i.e. the step should be loop invariant).  */
-  step = force_gimple_operand (step, &stmts, true, var);
+  step = force_gimple_operand (step, &stmts, true, var1);
   if (stmts)
     bsi_insert_on_edge_immediate (pe, stmts);
 
Index: tree-ssa-loop-ivopts.c
===================================================================
--- tree-ssa-loop-ivopts.c	(revision 127066)
+++ tree-ssa-loop-ivopts.c	(working copy)
@@ -901,7 +901,12 @@ find_bivs (struct ivopts_data *data)
       type = TREE_TYPE (PHI_RESULT (phi));
       base = fold_convert (type, base);
       if (step)
-	step = fold_convert (type, step);
+	{
+	  if (POINTER_TYPE_P (type))
+	    step = fold_convert (sizetype, step);
+	  else
+	    step = fold_convert (type, step);
+	}
 
       set_iv (data, PHI_RESULT (phi), base, step);
       found = true;
@@ -1934,7 +1939,7 @@ add_candidate_1 (struct ivopts_data *dat
     {
       orig_type = TREE_TYPE (base);
       type = generic_type_for (orig_type);
-      if (type != orig_type)
+      if (type != orig_type && !POINTER_TYPE_P (orig_type))
 	{
 	  base = fold_convert (type, base);
 	  step = fold_convert (type, step);
@@ -2131,13 +2136,17 @@ add_iv_value_candidates (struct ivopts_d
 {
   unsigned HOST_WIDE_INT offset;
   tree base;
+  tree basetype;
 
   add_candidate (data, iv->base, iv->step, false, use);
 
   /* The same, but with initial value zero.  Make such variable important,
      since it is generic enough so that possibly many uses may be based
      on it.  */
-  add_candidate (data, build_int_cst (TREE_TYPE (iv->base), 0),
+  basetype = TREE_TYPE (iv->base);
+  if (POINTER_TYPE_P (basetype))
+    basetype = sizetype;
+  add_candidate (data, build_int_cst (basetype, 0),
 		 iv->step, true, use);
 
   /* Third, try removing the constant offset.  */
@@ -3562,10 +3571,13 @@ cand_value_at (struct loop *loop, struct
   aff_tree step, delta, nit;
   struct iv *iv = cand->iv;
   tree type = TREE_TYPE (iv->base);
+  tree steptype = type;
+  if (POINTER_TYPE_P (type))
+    steptype = sizetype;
 
-  tree_to_aff_combination (iv->step, type, &step);
+  tree_to_aff_combination (iv->step, steptype, &step);
   tree_to_aff_combination (niter, TREE_TYPE (niter), &nit);
-  aff_combination_convert (&nit, type);
+  aff_combination_convert (&nit, steptype);
   aff_combination_mult (&nit, &step, &delta);
   if (stmt_after_increment (loop, cand, at))
     aff_combination_add (&delta, &step);
Index: tree-ssa-address.c
===================================================================
--- tree-ssa-address.c	(revision 127066)
+++ tree-ssa-address.c	(working copy)
@@ -422,9 +422,13 @@ add_to_parts (struct mem_address *parts,
 
   /* Add ELT to base.  */
   type = TREE_TYPE (parts->base);
-  parts->base = fold_build2 (PLUS_EXPR, type,
-			     parts->base,
-			     fold_convert (type, elt));
+  if (POINTER_TYPE_P (type))
+    parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
+			       parts->base, fold_convert (sizetype, elt));
+  else
+    parts->base = fold_build2 (PLUS_EXPR, type,
+			       parts->base,
+			       fold_convert (type, elt));
 }
 
 /* Finds the most expensive multiplication in ADDR that can be
Index: tree-affine.c
===================================================================
--- tree-affine.c	(revision 127066)
+++ tree-affine.c	(working copy)
@@ -279,7 +279,6 @@ tree_to_aff_combination (tree expr, tree
     case POINTER_PLUS_EXPR:
       tree_to_aff_combination (TREE_OPERAND (expr, 0), type, comb);
       tree_to_aff_combination (TREE_OPERAND (expr, 1), sizetype, &tmp);
-      aff_combination_convert (&tmp, type);
       aff_combination_add (comb, &tmp);
       return;
 
@@ -350,29 +349,40 @@ add_elt_to_tree (tree expr, tree type, t
 		 aff_tree *comb)
 {
   enum tree_code code;
+  tree type1 = type;
+  if (POINTER_TYPE_P (type))
+    type1 = sizetype;
 
   scale = double_int_ext_for_comb (scale, comb);
-  elt = fold_convert (type, elt);
+  elt = fold_convert (type1, elt);
 
   if (double_int_one_p (scale))
     {
       if (!expr)
-	return elt;
+	return fold_convert (type, elt);
 
+      if (POINTER_TYPE_P (type))
+        return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
       return fold_build2 (PLUS_EXPR, type, expr, elt);
     }
 
   if (double_int_minus_one_p (scale))
     {
       if (!expr)
-	return fold_build1 (NEGATE_EXPR, type, elt);
+	return fold_convert (type, fold_build1 (NEGATE_EXPR, type1, elt));
 
+      if (POINTER_TYPE_P (type))
+	{
+	  elt = fold_build1 (NEGATE_EXPR, type1, elt);
+	  return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+	}
       return fold_build2 (MINUS_EXPR, type, expr, elt);
     }
 
   if (!expr)
-    return fold_build2 (MULT_EXPR, type, elt,
-			double_int_to_tree (type, scale));
+    return fold_convert (type,
+			 fold_build2 (MULT_EXPR, type1, elt,
+				      double_int_to_tree (type1, scale)));
 
   if (double_int_negative_p (scale))
     {
@@ -382,8 +392,14 @@ add_elt_to_tree (tree expr, tree type, t
   else
     code = PLUS_EXPR;
 
-  elt = fold_build2 (MULT_EXPR, type, elt,
-		     double_int_to_tree (type, scale));
+  elt = fold_build2 (MULT_EXPR, type1, elt,
+		     double_int_to_tree (type1, scale));
+  if (POINTER_TYPE_P (type))
+    {
+      if (code == MINUS_EXPR)
+        elt = fold_build1 (NEGATE_EXPR, type1, elt);
+      return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+    }
   return fold_build2 (code, type, expr, elt);
 }
 
@@ -396,6 +412,9 @@ aff_combination_to_tree (aff_tree *comb)
   tree expr = comb->rest;
   unsigned i;
   double_int off, sgn;
+  tree type1 = type;
+  if (POINTER_TYPE_P (type))
+    type1 = sizetype;
 
   gcc_assert (comb->n == MAX_AFF_ELTS || comb->rest == NULL_TREE);
 
@@ -415,7 +434,7 @@ aff_combination_to_tree (aff_tree *comb)
       off = comb->offset;
       sgn = double_int_one;
     }
-  return add_elt_to_tree (expr, type, double_int_to_tree (type, off), sgn,
+  return add_elt_to_tree (expr, type, double_int_to_tree (type1, off), sgn,
 			  comb);
 }
 

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

* Re: [PATCH] Fix IV-opts so it no longer produces MEM[index:]
  2007-08-01  2:36 [PATCH] Fix IV-opts so it no longer produces MEM[index:] Andrew_Pinski
@ 2007-08-01  9:52 ` Zdenek Dvorak
  2007-08-01 21:18   ` Andrew_Pinski
  2007-08-10 21:21   ` Andrew Pinski
  0 siblings, 2 replies; 6+ messages in thread
From: Zdenek Dvorak @ 2007-08-01  9:52 UTC (permalink / raw)
  To: Andrew_Pinski; +Cc: gcc-patches

Hello,

> Index: tree-ssa-loop-manip.c
> ===================================================================
> --- tree-ssa-loop-manip.c	(revision 127066)
> +++ tree-ssa-loop-manip.c	(working copy)
> @@ -56,12 +56,15 @@ create_iv (tree base, tree step, tree va
>    tree vb, va;
>    enum tree_code incr_op = PLUS_EXPR;
>    edge pe = loop_preheader_edge (loop);
> +  tree var1;
>  
>    if (!var)
>      {
>        var = create_tmp_var (TREE_TYPE (base), "ivtmp");
>        add_referenced_var (var);
>      }
> +  var1 = create_tmp_var (TREE_TYPE (step), "ivtmp");
> +  add_referenced_var (var1);
>  
>    vb = make_ssa_name (var, NULL_TREE);
>    if (var_before)
> @@ -104,7 +107,7 @@ create_iv (tree base, tree step, tree va
>      }
>    /* Gimplify the step if necessary.  We put the computations in front of the
>       loop (i.e. the step should be loop invariant).  */
> -  step = force_gimple_operand (step, &stmts, true, var);
> +  step = force_gimple_operand (step, &stmts, true, var1);

just change this to
step = force_gimple_operand (step, &stmts, true, NULL_TREE);

> @@ -1934,7 +1939,7 @@ add_candidate_1 (struct ivopts_data *dat
>      {
>        orig_type = TREE_TYPE (base);
>        type = generic_type_for (orig_type);
> -      if (type != orig_type)
> +      if (type != orig_type && !POINTER_TYPE_P (orig_type))
>  	{
>  	  base = fold_convert (type, base);
>  	  step = fold_convert (type, step);

You still need to convert base to type.

> Index: tree-affine.c
> ===================================================================
> --- tree-affine.c	(revision 127066)
> +++ tree-affine.c	(working copy)
> @@ -350,29 +349,40 @@ add_elt_to_tree (tree expr, tree type, t
>  		 aff_tree *comb)
>  {
>    enum tree_code code;
> +  tree type1 = type;
> +  if (POINTER_TYPE_P (type))
> +    type1 = sizetype;
>  
>    scale = double_int_ext_for_comb (scale, comb);
> -  elt = fold_convert (type, elt);
> +  elt = fold_convert (type1, elt);
>  
>    if (double_int_one_p (scale))
>      {
>        if (!expr)
> -	return elt;
> +	return fold_convert (type, elt);

These changes look wrong; for example, if aff_combination_to_tree is
called with combination with elements i and p (where type of p = int *
and type of i is sizetype), this would end up producing
(int *) i PPLUS (sizetype) p.  I think aff_combination_to_tree needs
to be rewritten to deal with the pointer type elements of the combination
separately.

Zdenek

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

* Re: [PATCH] Fix IV-opts so it no longer produces MEM[index:]
  2007-08-01  9:52 ` Zdenek Dvorak
@ 2007-08-01 21:18   ` Andrew_Pinski
  2007-08-07 12:26     ` Andrew Pinski
  2007-08-10 21:21   ` Andrew Pinski
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew_Pinski @ 2007-08-01 21:18 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: gcc-patches

Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote on 08/01/2007 02:52:36 AM:

> Hello,
> > @@ -1934,7 +1939,7 @@ add_candidate_1 (struct ivopts_data *dat
> >      {
> >        orig_type = TREE_TYPE (base);
> >        type = generic_type_for (orig_type);
> > -      if (type != orig_type)
> > +      if (type != orig_type && !POINTER_TYPE_P (orig_type))
> >     {
> >       base = fold_convert (type, base);
> >       step = fold_convert (type, step);
> 
> You still need to convert base to type.

No, this is why we are getting MEM[index:] as generic_type_for for pointer 
types is unsigned_type_for and unsigned_type_for  returns the same size 
integer as the pointer which is not what we want here really.  Maybe we 
should return the pointer to void type instead?

Thanks,
Andrew Pinski

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

* Re: [PATCH] Fix IV-opts so it no longer produces MEM[index:]
  2007-08-01 21:18   ` Andrew_Pinski
@ 2007-08-07 12:26     ` Andrew Pinski
  2007-08-08 10:18       ` Zdenek Dvorak
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2007-08-07 12:26 UTC (permalink / raw)
  To: Andrew_Pinski; +Cc: Zdenek Dvorak, gcc-patches

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

On 8/1/07, Andrew_Pinski@playstation.sony.com
> No, this is why we are getting MEM[index:] as generic_type_for for pointer
> types is unsigned_type_for and unsigned_type_for  returns the same size
> integer as the pointer which is not what we want here really.  Maybe we
> should return the pointer to void type instead?

Here is a new patch with an additional comment on why not converting
to type is necessary/correct.  It also takes into account your comment
about create_iv.

OK? Bootstrapped and tested on i386-apple-darwin8.10 with no regressions.

Thanks,
Andrew Pinski

       * tree-ssa-loop-manip.c (create_iv): Call force_gimple_operand for
       the step with a NULL_TREE.
       * tree-ssa-loop-ivopts.c (find_bivs): Convert the step
       to sizetype if type is a pointer type.
       (add_candidate_1): Don't convert the base and step to
       the generic type if the orginal type is a pointer type.
       (add_iv_value_candidates): Use sizetype for the step
       if type is a pointer type.
       (cand_value_at): Likewise.
       * tree-ssa-address.c (add_to_parts): Use POINTER_PLUS_EXPR
       for pointer types.
       * tree-affine.c (tree_to_aff_combination <POINTER_PLUS_EXPR>):
       Don't convert the tem affine to the type.
       (add_elt_to_tree): Use sizetype for the step if a pointer.
       Use POINTER_PLUS_EXPR for pointers.
       (aff_combination_to_tree): Use sizetype for the step if a
       pointer.

[-- Attachment #2: fixivopts.diff.txt --]
[-- Type: text/plain, Size: 5751 bytes --]

Index: tree-ssa-loop-manip.c
===================================================================
--- tree-ssa-loop-manip.c	(revision 127266)
+++ tree-ssa-loop-manip.c	(working copy)
@@ -104,7 +104,7 @@ create_iv (tree base, tree step, tree va
     }
   /* Gimplify the step if necessary.  We put the computations in front of the
      loop (i.e. the step should be loop invariant).  */
-  step = force_gimple_operand (step, &stmts, true, var);
+  step = force_gimple_operand (step, &stmts, true, NULL_TREE);
   if (stmts)
     bsi_insert_on_edge_immediate (pe, stmts);
 
Index: tree-ssa-loop-ivopts.c
===================================================================
--- tree-ssa-loop-ivopts.c	(revision 127266)
+++ tree-ssa-loop-ivopts.c	(working copy)
@@ -901,7 +901,12 @@ find_bivs (struct ivopts_data *data)
       type = TREE_TYPE (PHI_RESULT (phi));
       base = fold_convert (type, base);
       if (step)
-	step = fold_convert (type, step);
+	{
+	  if (POINTER_TYPE_P (type))
+	    step = fold_convert (sizetype, step);
+	  else
+	    step = fold_convert (type, step);
+	}
 
       set_iv (data, PHI_RESULT (phi), base, step);
       found = true;
@@ -1934,7 +1939,9 @@ add_candidate_1 (struct ivopts_data *dat
     {
       orig_type = TREE_TYPE (base);
       type = generic_type_for (orig_type);
-      if (type != orig_type)
+      /* Don't convert the base to the generic type for pointers as the generic
+	 type is an integer type with the same size as the pointer type.  */
+      if (type != orig_type && !POINTER_TYPE_P (orig_type))
 	{
 	  base = fold_convert (type, base);
 	  step = fold_convert (type, step);
@@ -2131,13 +2138,17 @@ add_iv_value_candidates (struct ivopts_d
 {
   unsigned HOST_WIDE_INT offset;
   tree base;
+  tree basetype;
 
   add_candidate (data, iv->base, iv->step, false, use);
 
   /* The same, but with initial value zero.  Make such variable important,
      since it is generic enough so that possibly many uses may be based
      on it.  */
-  add_candidate (data, build_int_cst (TREE_TYPE (iv->base), 0),
+  basetype = TREE_TYPE (iv->base);
+  if (POINTER_TYPE_P (basetype))
+    basetype = sizetype;
+  add_candidate (data, build_int_cst (basetype, 0),
 		 iv->step, true, use);
 
   /* Third, try removing the constant offset.  */
@@ -3562,10 +3573,13 @@ cand_value_at (struct loop *loop, struct
   aff_tree step, delta, nit;
   struct iv *iv = cand->iv;
   tree type = TREE_TYPE (iv->base);
+  tree steptype = type;
+  if (POINTER_TYPE_P (type))
+    steptype = sizetype;
 
-  tree_to_aff_combination (iv->step, type, &step);
+  tree_to_aff_combination (iv->step, steptype, &step);
   tree_to_aff_combination (niter, TREE_TYPE (niter), &nit);
-  aff_combination_convert (&nit, type);
+  aff_combination_convert (&nit, steptype);
   aff_combination_mult (&nit, &step, &delta);
   if (stmt_after_increment (loop, cand, at))
     aff_combination_add (&delta, &step);
Index: tree-affine.c
===================================================================
--- tree-affine.c	(revision 127266)
+++ tree-affine.c	(working copy)
@@ -279,7 +279,6 @@ tree_to_aff_combination (tree expr, tree
     case POINTER_PLUS_EXPR:
       tree_to_aff_combination (TREE_OPERAND (expr, 0), type, comb);
       tree_to_aff_combination (TREE_OPERAND (expr, 1), sizetype, &tmp);
-      aff_combination_convert (&tmp, type);
       aff_combination_add (comb, &tmp);
       return;
 
@@ -350,29 +349,40 @@ add_elt_to_tree (tree expr, tree type, t
 		 aff_tree *comb)
 {
   enum tree_code code;
+  tree type1 = type;
+  if (POINTER_TYPE_P (type))
+    type1 = sizetype;
 
   scale = double_int_ext_for_comb (scale, comb);
-  elt = fold_convert (type, elt);
+  elt = fold_convert (type1, elt);
 
   if (double_int_one_p (scale))
     {
       if (!expr)
-	return elt;
+	return fold_convert (type, elt);
 
+      if (POINTER_TYPE_P (type))
+        return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
       return fold_build2 (PLUS_EXPR, type, expr, elt);
     }
 
   if (double_int_minus_one_p (scale))
     {
       if (!expr)
-	return fold_build1 (NEGATE_EXPR, type, elt);
+	return fold_convert (type, fold_build1 (NEGATE_EXPR, type1, elt));
 
+      if (POINTER_TYPE_P (type))
+	{
+	  elt = fold_build1 (NEGATE_EXPR, type1, elt);
+	  return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+	}
       return fold_build2 (MINUS_EXPR, type, expr, elt);
     }
 
   if (!expr)
-    return fold_build2 (MULT_EXPR, type, elt,
-			double_int_to_tree (type, scale));
+    return fold_convert (type,
+			 fold_build2 (MULT_EXPR, type1, elt,
+				      double_int_to_tree (type1, scale)));
 
   if (double_int_negative_p (scale))
     {
@@ -382,8 +392,14 @@ add_elt_to_tree (tree expr, tree type, t
   else
     code = PLUS_EXPR;
 
-  elt = fold_build2 (MULT_EXPR, type, elt,
-		     double_int_to_tree (type, scale));
+  elt = fold_build2 (MULT_EXPR, type1, elt,
+		     double_int_to_tree (type1, scale));
+  if (POINTER_TYPE_P (type))
+    {
+      if (code == MINUS_EXPR)
+        elt = fold_build1 (NEGATE_EXPR, type1, elt);
+      return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
+    }
   return fold_build2 (code, type, expr, elt);
 }
 
@@ -396,6 +412,9 @@ aff_combination_to_tree (aff_tree *comb)
   tree expr = comb->rest;
   unsigned i;
   double_int off, sgn;
+  tree type1 = type;
+  if (POINTER_TYPE_P (type))
+    type1 = sizetype;
 
   gcc_assert (comb->n == MAX_AFF_ELTS || comb->rest == NULL_TREE);
 
@@ -415,7 +434,7 @@ aff_combination_to_tree (aff_tree *comb)
       off = comb->offset;
       sgn = double_int_one;
     }
-  return add_elt_to_tree (expr, type, double_int_to_tree (type, off), sgn,
+  return add_elt_to_tree (expr, type, double_int_to_tree (type1, off), sgn,
 			  comb);
 }
 

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

* Re: [PATCH] Fix IV-opts so it no longer produces MEM[index:]
  2007-08-07 12:26     ` Andrew Pinski
@ 2007-08-08 10:18       ` Zdenek Dvorak
  0 siblings, 0 replies; 6+ messages in thread
From: Zdenek Dvorak @ 2007-08-08 10:18 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Andrew_Pinski, gcc-patches

Hello,

> On 8/1/07, Andrew_Pinski@playstation.sony.com
> > No, this is why we are getting MEM[index:] as generic_type_for for pointer
> > types is unsigned_type_for and unsigned_type_for  returns the same size
> > integer as the pointer which is not what we want here really.  Maybe we
> > should return the pointer to void type instead?
> 
> Here is a new patch with an additional comment on why not converting
> to type is necessary/correct.  It also takes into account your comment
> about create_iv.
> 
> OK? Bootstrapped and tested on i386-apple-darwin8.10 with no regressions.

the tree-ssa-loop-manip.c and tree-ssa-loop-ivopts.c pieces are OK.  I
think you did not fix the tree-affine.c part?

Zdenek

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

* Re: [PATCH] Fix IV-opts so it no longer produces MEM[index:]
  2007-08-01  9:52 ` Zdenek Dvorak
  2007-08-01 21:18   ` Andrew_Pinski
@ 2007-08-10 21:21   ` Andrew Pinski
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2007-08-10 21:21 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: Andrew_Pinski, gcc-patches

On 8/1/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> These changes look wrong; for example, if aff_combination_to_tree is
> called with combination with elements i and p (where type of p = int *
> and type of i is sizetype), this would end up producing
> (int *) i PPLUS (sizetype) p.

Even if we produce that, fold_binary will convert it to be p PPLUS i
anyways.  So this might be ok, I have to double check (maybe this is
no longer needed).

Thanks,
Andrew Pinski

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

end of thread, other threads:[~2007-08-10 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01  2:36 [PATCH] Fix IV-opts so it no longer produces MEM[index:] Andrew_Pinski
2007-08-01  9:52 ` Zdenek Dvorak
2007-08-01 21:18   ` Andrew_Pinski
2007-08-07 12:26     ` Andrew Pinski
2007-08-08 10:18       ` Zdenek Dvorak
2007-08-10 21:21   ` Andrew Pinski

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