Patchwork [51/65] Do not instantiate default definitions in instantiate_scev_name.

login
register
mail settings
Submitter Sebastian Pop
Date Aug. 2, 2010, 8:20 p.m.
Message ID <1280780438-17543-52-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/60649/
State New
Headers show

Comments

Sebastian Pop - Aug. 2, 2010, 8:20 p.m.
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>

2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>

	* tree-scalar-evolution.c (instantiate_scev_name): Do not
	instantiate default definitions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162444 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog               |    5 +++++
 gcc/ChangeLog.graphite      |    5 +++++
 gcc/tree-scalar-evolution.c |   13 ++++++++-----
 3 files changed, 18 insertions(+), 5 deletions(-)

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7064ecc..ff88292 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* tree-scalar-evolution.c (instantiate_scev_name): Do not
+	instantiate default definitions.
+
 2010-08-02  Vladimir Kargov  <kargov@gmail.com>
 	    Sebastian Pop  <sebastian.pop@amd.com>
 
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 699a8a6..155e396 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@ 
+2010-07-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* tree-scalar-evolution.c (instantiate_scev_name): Do not
+	instantiate default definitions.
+
 2010-07-20  Vladimir Kargov  <kargov@gmail.com>
 
 	* graphite-scop-detection.c (is_valid_stmt_p): New.
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 0e37256..edf8b3e 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -2179,11 +2179,15 @@  instantiate_scev_name (basic_block instantiate_below,
      result again.  */
   res = analyze_scalar_evolution (def_loop, chrec);
 
-  /* Don't instantiate loop-closed-ssa phi nodes.  */
+  /* Don't instantiate default definitions.  */
   if (TREE_CODE (res) == SSA_NAME
-      && (loop_containing_stmt (SSA_NAME_DEF_STMT (res)) == NULL
-	  || (loop_depth (loop_containing_stmt (SSA_NAME_DEF_STMT (res)))
-	      > loop_depth (def_loop))))
+      && SSA_NAME_IS_DEFAULT_DEF (res))
+    ;
+
+  /* Don't instantiate loop-closed-ssa phi nodes.  */
+  else if (TREE_CODE (res) == SSA_NAME
+	   && loop_depth (loop_containing_stmt (SSA_NAME_DEF_STMT (res)))
+	   > loop_depth (def_loop))
     {
       if (res == chrec)
 	res = loop_closed_phi_def (chrec);
@@ -2213,7 +2217,6 @@  instantiate_scev_name (basic_block instantiate_below,
   /* Store the correct value to the cache.  */
   set_instantiated_value (cache, instantiate_below, chrec, res);
   return res;
-
 }
 
 /* Analyze all the parameters of the chrec, between INSTANTIATE_BELOW