Patchwork [12/28] Correct the precedence relation.

login
register
mail settings
Submitter Sebastian Pop
Date Jan. 21, 2011, 7:27 p.m.
Message ID <1295638067-13460-13-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/79895/
State New
Headers show

Comments

Sebastian Pop - Jan. 21, 2011, 7:27 p.m.
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>

2011-01-15  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-dependences.c (build_pairwise_scheduling): Correctly compute
	the "a followed by b" relation and document it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@168838 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog              |    5 +++++
 gcc/ChangeLog.graphite     |    5 +++++
 gcc/graphite-dependences.c |   15 ++++++++++-----
 3 files changed, 20 insertions(+), 5 deletions(-)

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 01dfc7e..e20aafd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@ 
 2011-01-21  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-dependences.c (build_pairwise_scheduling): Correctly compute
+	the "a followed by b" relation and document it.
+
+2011-01-21  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-dependences.c (build_lexicographical_constraint): Stop the
 	iteration when the bag of constraints is empty.
 
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 0db1c60..ab1498a 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@ 
 2011-01-15  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-dependences.c (build_pairwise_scheduling): Correctly compute
+	the "a followed by b" relation and document it.
+
+2011-01-15  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-dependences.c (build_lexicographical_constraint): Stop the
 	iteration when the bag of constraints is empty.
 
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index c9bd1be..0164129 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -347,23 +347,28 @@  build_pairwise_scheduling (graphite_dim_t dim,
   ppl_Pointset_Powerset_C_Polyhedron_t res;
   ppl_Polyhedron_t equalities;
   ppl_Constraint_t cstr;
+  graphite_dim_t a = pos;
+  graphite_dim_t b = pos + offset;
 
   ppl_new_C_Polyhedron_from_space_dimension (&equalities, dim, 0);
 
   switch (direction)
     {
-    case -1:
-      cstr = ppl_build_relation (dim, pos, pos + offset, 1,
+    case 1:
+      /* Builds "a + 1 <= b.  */
+      cstr = ppl_build_relation (dim, a, b, 1,
 				 PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
       break;
 
     case 0:
-      cstr = ppl_build_relation (dim, pos, pos + offset, 0,
+      /* Builds "a = b.  */
+      cstr = ppl_build_relation (dim, a, b, 0,
 				 PPL_CONSTRAINT_TYPE_EQUAL);
       break;
 
-    case 1:
-      cstr = ppl_build_relation (dim, pos, pos + offset, -1,
+    case -1:
+      /* Builds "a >= b + 1.  */
+      cstr = ppl_build_relation (dim, a, b, -1,
 				 PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
       break;