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: [patch] Fix PR43464: update loop closed SSA form once copy prop is done


On Wed, Mar 31, 2010 at 12:48, Sebastian Pop <sebpop@gmail.com> wrote:
> On Wed, Mar 31, 2010 at 06:28, Michael Matz <matz@suse.de> wrote:
>> At least graphite-sese-to-poly.c, lambda-code.c and possibly
>> tree-ssa-pre.c would need something similar.
>
> Yes, this is the case. ?I will prepare similar patches for these passes.

The attached patch fixes the problem in graphite-sese-to-poly.c
I will commit this patch in the Graphite branch for further testing.

Michael, do you see other places in graphite-sese-to-poly.c that
may still have similar problems?

Thanks,
Sebastian
From 6d4d9d653bc60018ad2e94e21beee7cb29b5fcab Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Wed, 31 Mar 2010 14:01:16 -0500
Subject: [PATCH] Loop close phi nodes may have more than one argument.

	* graphite-sese-to-poly.c (scalar_close_phi_node_p): Loop
	close phi nodes may have more than one argument.
---
 gcc/graphite-sese-to-poly.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index d358137..bb241da 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2179,11 +2179,23 @@ create_zero_dim_array (tree var, const char *base_name)
 static bool
 scalar_close_phi_node_p (gimple phi)
 {
+  edge_iterator ei;
+  edge e;
+  basic_block bb;
+
   if (gimple_code (phi) != GIMPLE_PHI
       || !is_gimple_reg (gimple_phi_result (phi)))
     return false;
 
-  return (gimple_phi_num_args (phi) == 1);
+  bb = gimple_bb (phi);
+
+  /* A loop close phi node contains at least one argument coming from
+     a loop exit edge.  */
+  FOR_EACH_EDGE (e, ei, bb->preds)
+    if (loop_exit_edge_p (e->src->loop_father, e))
+      return true;
+
+  return false;
 }
 
 /* Rewrite out of SSA the reduction phi node at PSI by creating a zero
-- 
1.6.3.3


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