* graphite-isl-ast-to-gimple.c: Fix comment.
* graphite-scop-detection.c (defined_in_loop_p): New.
(canonicalize_loop_closed_ssa): Do not add close phi nodes for SSA
names defined in loop.
gcc/testsuite
* gcc.dg/graphite/pr68976.c: New test.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r232658
+2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ * graphite-isl-ast-to-gimple.c: Fix comment.
+ * graphite-scop-detection.c (defined_in_loop_p): New.
+ (canonicalize_loop_closed_ssa): Do not add close phi nodes for SSA
+ names defined in loop.
+
2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
/* Return the tree variable that corresponds to the given isl ast identifier
expression (an isl_ast_expr of type isl_ast_expr_id).
- FIXME: We should replace blind conversation of id's type with derivation
- of the optimal type when we get the corresponding isl support. Blindly
+ FIXME: We should replace blind conversion of id's type with derivation
+ of the optimal type when we get the corresponding isl support. Blindly
converting type sizes may be problematic when we switch to smaller
types. */
}
}
+/* Return true when NAME is defined in LOOP. */
+
+static bool
+defined_in_loop_p (tree name, loop_p loop)
+{
+ gcc_assert (TREE_CODE (name) == SSA_NAME);
+ return loop == loop_containing_stmt (SSA_NAME_DEF_STMT (name));
+}
+
/* Transforms LOOP to the canonical loop closed SSA form. */
static void
use_operand_p use_p;
gphi *close_phi;
- if (TREE_CODE (arg) != SSA_NAME)
+ /* Only add close phi nodes for SSA_NAMEs defined in LOOP. */
+ if (TREE_CODE (arg) != SSA_NAME
+ || !defined_in_loop_p (arg, loop))
continue;
close_phi = create_phi_node (NULL_TREE, close);
+2016-01-21 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ * gcc.dg/graphite/pr68976.c: New test.
+
2016-01-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67653
--- /dev/null
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int kw = -1, hv = -1, ju;
+int mc[1];
+void xx(void)
+{
+ for (; kw; ++kw)
+ for (; hv; ++hv)
+ for (ju = 0; ju < 2; ++ju)
+ mc[kw+1] = mc[0];
+}