+2015-09-28 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ PR tree-optimization/67700
+ * graphite-sese-to-poly.c (parameter_index_in_region): Call
+ invariant_in_sese_p_rec.
+ (extract_affine): Same.
+ (rewrite_cross_bb_scalar_deps): Call update_ssa.
+ * sese.c (invariant_in_sese_p_rec): Export. Handle vdefs and vuses.
+ * sese.h (invariant_in_sese_p_rec): Declare.
+
2015-09-28 David Wohlferd <dw@LimeGreenSocks.com>
* doc/extend.texi (Asm Labels): Break out text for data vs
if (TREE_CODE (TREE_TYPE (name)) != INTEGER_TYPE)
return -1;
+ if (!invariant_in_sese_p_rec (name, region))
+ return -1;
+
i = parameter_index_in_region_1 (name, region);
if (i != -1)
return i;
break;
case SSA_NAME:
- gcc_assert (-1 != parameter_index_in_region_1 (e, SCOP_REGION (s)));
+ gcc_assert (-1 != parameter_index_in_region_1 (e, s->region)
+ || !invariant_in_sese_p_rec (e, s->region));
res = extract_affine_name (s, e, space);
break;
def, use_stmt);
}
+ update_ssa (TODO_update_ssa);
+
return res;
}
gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT);
}
-/* Return false if T is completely defined outside REGION. */
+/* Return true when T is defined outside REGION or when no definitions are
+ variant in REGION. */
-static bool
+bool
invariant_in_sese_p_rec (tree t, sese region)
{
ssa_op_iter iter;
|| gimple_code (stmt) == GIMPLE_CALL)
return false;
+ /* VDEF is variant when it is in the region. */
+ if (tree vdef = gimple_vdef (stmt))
+ 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);
+
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
{
tree use = USE_FROM_PTR (use_p);
+
if (!defined_in_sese_p (use, region))
continue;
vec<tree> , bool *);
extern struct loop *outermost_loop_in_sese (sese, basic_block);
extern tree scalar_evolution_in_region (sese, loop_p, tree);
+extern bool invariant_in_sese_p_rec (tree, sese);
/* Check that SESE contains LOOP. */
+2015-09-28 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ PR tree-optimization/67700
+ * testsuite/gcc.dg/graphite/run-id-pr67700.c: New.
+
2015-09-28 Oleg Endo <olegendo@gcc.gnu.org>
PR target/54236
--- /dev/null
+#include <stdlib.h>
+#include <assert.h>
+
+struct abc {
+ int a[81];
+} *abcd;
+
+#define FPMATH_SSE 2
+int global;
+
+void __attribute__ ((noinline)) foo()
+{
+ int pos = 0;
+ int i;
+
+ if (!((global & FPMATH_SSE) != 0))
+ for (i = 8; i <= 15; i++)
+ abcd->a[pos++] = i;
+
+ for (i = 29; i <= 36; i++)
+ abcd->a[pos++] = i;
+}
+
+int main()
+{
+ int i;
+ abcd = (struct abc*) malloc (sizeof (struct abc));
+ for (i = 0; i <= 80; i++)
+ abcd->a[i] = 0;
+
+ foo();
+
+ assert (abcd->a[8] == 29);
+
+ return 0;
+}