Patchwork [1/6] Factor out is_gimple_reg calls.

login
register
mail settings
Submitter Sebastian Pop
Date Aug. 20, 2010, 11:44 p.m.
Message ID <1282347880-797-2-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/62333/
State New
Headers show

Comments

Sebastian Pop - Aug. 20, 2010, 11:44 p.m.
2010-08-20  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (reduction_phi_p): Remove check for
	is_gimple_reg.
	(rewrite_degenerate_phi): Same.
	(rewrite_reductions_out_of_ssa): Add check for is_gimple_reg.
---
 gcc/ChangeLog.graphite      |    7 +++++++
 gcc/graphite-sese-to-poly.c |   18 ++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 0282171..34bd5be 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@ 
+2010-08-20  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (reduction_phi_p): Remove check for
+	is_gimple_reg.
+	(rewrite_degenerate_phi): Same.
+	(rewrite_reductions_out_of_ssa): Add check for is_gimple_reg.
+
 2010-08-17  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/45229
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 0f44a92..d44564d 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -168,12 +168,6 @@  reduction_phi_p (sese region, gimple_stmt_iterator *psi)
   gimple phi = gsi_stmt (*psi);
   tree res = gimple_phi_result (phi);
 
-  if (!is_gimple_reg (res))
-    {
-      gsi_next (psi);
-      return false;
-    }
-
   loop = loop_containing_stmt (phi);
 
   if (simple_copy_phi_p (phi))
@@ -2358,12 +2352,6 @@  rewrite_degenerate_phi (gimple_stmt_iterator *psi)
   tree res = gimple_phi_result (phi);
   basic_block bb;
 
-  if (!is_gimple_reg (res))
-    {
-      gsi_next (psi);
-      return;
-    }
-
   bb = gimple_bb (phi);
   rhs = degenerate_phi_result (phi);
   gcc_assert (rhs);
@@ -2391,6 +2379,12 @@  rewrite_reductions_out_of_ssa (scop_p scop)
 	{
 	  gimple phi = gsi_stmt (psi);
 
+	  if (!is_gimple_reg (gimple_phi_result (phi)))
+	    {
+	      gsi_next (&psi);
+	      continue;
+	    }
+
 	  if (gimple_phi_num_args (phi) > 1
 	      && degenerate_phi_result (phi))
 	    rewrite_degenerate_phi (&psi);