[gcc/]
authorRoman Gareev <gareevroman@gmail.com>
Mon, 28 Jul 2014 06:01:24 +0000 (06:01 +0000)
committerRoman Gareev <romangareev@gcc.gnu.org>
Mon, 28 Jul 2014 06:01:24 +0000 (06:01 +0000)
* graphite-sese-to-poly.c:
(new_pbb_from_pbb): Set a new id of pbb1->domain (instead of using the
id of the pbb), which contains pointer to the pbb1.

[gcc/testsuite]

* gcc.dg/graphite/isl-ast-gen-if-2.c: New testcase.

From-SVN: r213110

gcc/ChangeLog
gcc/graphite-sese-to-poly.c
gcc/testsuite/gcc.dg/graphite/isl-ast-gen-if-2.c [new file with mode: 0644]

index 187f988..5476b59 100644 (file)
@@ -1,5 +1,13 @@
 2014-07-28  Roman Gareev  <gareevroman@gmail.com>
 
+       * graphite-sese-to-poly.c:
+       (new_pbb_from_pbb): Set a new id of pbb1->domain (instead of using the
+       id of the pbb), which contains pointer to the pbb1.
+
+       * gcc.dg/graphite/isl-ast-gen-if-2.c: New testcase.
+
+2014-07-28  Roman Gareev  <gareevroman@gmail.com>
+
        * graphite-isl-ast-to-gimple.c:
        (graphite_create_new_guard): New function.
        (translate_isl_ast_node_if): New function.
index 0bc4433..3254df9 100644 (file)
@@ -2044,6 +2044,8 @@ new_pbb_from_pbb (scop_p scop, poly_bb_p pbb, basic_block bb)
       break;
 
   pbb1->domain = isl_set_copy (pbb->domain);
+  pbb1->domain = isl_set_set_tuple_id (pbb1->domain,
+                                      isl_id_for_pbb (scop, pbb1));
 
   GBB_PBB (gbb1) = pbb1;
   GBB_CONDITIONS (gbb1) = GBB_CONDITIONS (gbb).copy ();
diff --git a/gcc/testsuite/gcc.dg/graphite/isl-ast-gen-if-2.c b/gcc/testsuite/gcc.dg/graphite/isl-ast-gen-if-2.c
new file mode 100644 (file)
index 0000000..512e43d
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fgraphite-identity -fgraphite-code-generator=isl" } */
+
+/* This test case tests reduction, where the pbbs are duplicated.  */
+
+static int __attribute__((noinline))
+foo ()
+{
+  int i, res = 0;
+
+  for (i = 0; i < 50; i++)
+    {
+      if (i >= 25)
+        res += i;
+    }
+
+  return res;
+}
+
+extern void abort ();
+
+int
+main (void)
+{ 
+  int res = foo ();
+
+  if (res != 925)
+    abort ();
+
+  return 0;
+}