@@ -426,22 +426,48 @@ subtract_commutative_associative_deps (scop_p scop,
*must_raw = isl_union_map_subtract (*must_raw, x_must_raw);
*may_raw = isl_union_map_subtract (*may_raw, x_may_raw);
- *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source,
- x_must_raw_no_source);
- *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source,
- x_may_raw_no_source);
+
+ if (must_raw_no_source)
+ *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source,
+ x_must_raw_no_source);
+ else
+ isl_union_map_free (x_must_raw_no_source);
+
+ if (may_raw_no_source)
+ *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source,
+ x_may_raw_no_source);
+ else
+ isl_union_map_free (x_may_raw_no_source);
+
*must_war = isl_union_map_subtract (*must_war, x_must_war);
*may_war = isl_union_map_subtract (*may_war, x_may_war);
- *must_war_no_source = isl_union_map_subtract (*must_war_no_source,
- x_must_war_no_source);
- *may_war_no_source = isl_union_map_subtract (*may_war_no_source,
- x_may_war_no_source);
+
+ if (must_war_no_source)
+ *must_war_no_source = isl_union_map_subtract (*must_war_no_source,
+ x_must_war_no_source);
+ else
+ isl_union_map_free (x_must_war_no_source);
+
+ if (may_war_no_source)
+ *may_war_no_source = isl_union_map_subtract (*may_war_no_source,
+ x_may_war_no_source);
+ else
+ isl_union_map_free (x_may_war_no_source);
+
*must_waw = isl_union_map_subtract (*must_waw, x_must_waw);
*may_waw = isl_union_map_subtract (*may_waw, x_may_waw);
- *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source,
- x_must_waw_no_source);
- *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source,
- x_may_waw_no_source);
+
+ if (must_waw_no_source)
+ *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source,
+ x_must_waw_no_source);
+ else
+ isl_union_map_free (x_must_waw_no_source);
+
+ if (may_waw_no_source)
+ *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source,
+ x_may_waw_no_source);
+ else
+ isl_union_map_free (x_may_waw_no_source);
}
isl_union_map_free (original);
b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
@@ -44,6 +44,7 @@ set interchange_files [lsort [glob -nocomplain
$srcdir/$subdir/interchange-*.\[f
set scop_files [lsort [glob -nocomplain
$srcdir/$subdir/scop-*.\[fF\]{,90,95,03,08} ] ]
set run_id_files [lsort [glob -nocomplain
$srcdir/$subdir/run-id-*.\[fF\]{,90,95,03,08} ] ]
set vect_files [lsort [glob -nocomplain
$srcdir/$subdir/vect-*.\[fF\]{,90,95,03,08} ] ]
+set parallelize_files [lsort [glob -nocomplain
$srcdir/$subdir/parallelize-all-*.\[fF\]{,90,95,03,08} ] ]
# Tests to be compiled.
set dg-do-what-default compile
@@ -51,6 +52,7 @@ gfortran-dg-runtest $scop_files "-O2
-fgraphite -fdump-tree-graphite-all"
gfortran-dg-runtest $id_files "-O2 -fgraphite-identity -ffast-math"
gfortran-dg-runtest $interchange_files "-O2 -floop-interchange
-fno-loop-block -fno-loop-strip-mine -ffast-math
-fdump-tree-graphite-all"
gfortran-dg-runtest $block_files "-O2 -floop-block
-fno-loop-strip-mine -fno-loop-interchange -ffast-math
-fdump-tree-graphite-all"
+gfortran-dg-runtest $parallelize_files "-Ofast -floop-parallelize-all"
# Vectorizer tests, to be run or compiled, depending on target capabilities.
if [check_vect_support_and_set_flags] {
b/gcc/testsuite/gfortran.dg/graphite/parallelize-all-1.f
new file mode 100644
@@ -0,0 +1,9 @@
+ subroutine subsm ( n, x, xp, xx)
+ integer n, m, x(n),xp(n), xx(n), gg(n), dd_p
+ do 55 i=1, n
+ dd_p = dd_p + (x(i) - xx(i))*gg(i)
+ 55 continue
+ if ( dd_p .gt. 0 ) then
+ call dcopy( n, xp, 1, x, 1 )
+ endif
+ end