+2015-10-21 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ * graphite-scop-detection.c (parameter_index_in_region): Update call to
+ invariant_in_sese_p_rec.
+ * graphite-sese-to-poly.c (extract_affine): Same.
+ * sese.c (invariant_in_sese_p_rec): Pass in an extra parameter has_vdefs.
+ (scalar_evolution_in_region): Return chrec_dont_know when the scalar variable
+ depends on virtual definitions in the current region.
+ * sese.h (invariant_in_sese_p_rec): Update declaration.
+
2015-10-21 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
if (TREE_CODE (TREE_TYPE (name)) != INTEGER_TYPE)
return -1;
- if (!invariant_in_sese_p_rec (name, region->region))
+ if (!invariant_in_sese_p_rec (name, region->region, NULL))
return -1;
i = parameter_index_in_region_1 (name, region);
case SSA_NAME:
gcc_assert (-1 != parameter_index_in_region_1 (e, s->scop_info)
- || !invariant_in_sese_p_rec (e, s->scop_info->region));
+ || !invariant_in_sese_p_rec (e, s->scop_info->region, NULL));
res = extract_affine_name (s, e, space);
break;
}
/* Return true when T is defined outside REGION or when no definitions are
- variant in REGION. */
+ variant in REGION. When HAS_VDEFS is a valid pointer, sets HAS_VDEFS to true
+ when T depends on memory that may change in REGION. */
bool
-invariant_in_sese_p_rec (tree t, sese_l ®ion)
+invariant_in_sese_p_rec (tree t, sese_l ®ion, bool *has_vdefs)
{
ssa_op_iter iter;
use_operand_p use_p;
/* VDEF is variant when it is in the region. */
if (gimple_vdef (stmt))
- return false;
+ {
+ if (has_vdefs)
+ *has_vdefs = true;
+ return false;
+ }
/* A VUSE may or may not be variant following the VDEFs. */
if (tree vuse = gimple_vuse (stmt))
- return invariant_in_sese_p_rec (vuse, region);
+ return invariant_in_sese_p_rec (vuse, region, has_vdefs);
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
{
if (!defined_in_sese_p (use, region))
continue;
- if (!invariant_in_sese_p_rec (use, region))
+ if (!invariant_in_sese_p_rec (use, region, has_vdefs))
return false;
}
return t;
}
- if (invariant_in_sese_p_rec (t, region))
+ bool has_vdefs = false;
+ if (invariant_in_sese_p_rec (t, region, &has_vdefs))
return t;
+ /* T variates in REGION. */
+ if (has_vdefs)
+ return chrec_dont_know;
+
return instantiate_scev (before, loop, t);
}
vec<tree> , bool *);
extern struct loop *outermost_loop_in_sese (sese_l &, basic_block);
extern tree scalar_evolution_in_region (sese_l &, loop_p, tree);
-extern bool invariant_in_sese_p_rec (tree, sese_l &);
+extern bool invariant_in_sese_p_rec (tree, sese_l &, bool *);
/* Check that SESE contains LOOP. */
+2015-10-21 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ * gcc.dg/graphite/scop-11.c: Update pattern.
+
2015-10-11 Jan Hubicka <hubicka@ucw.cz>
PR ipa/67056
return a[b];
}
-/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite"} } */