From 97744494766c0f53bdb293b61fa97da71a3a1f3e Mon Sep 17 00:00:00 2001 From: rguenth Date: Fri, 16 Feb 2018 08:16:17 +0000 Subject: 2018-02-16 Richard Biener PR tree-optimization/84399 * graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p): For operands we can analyze at their definition make sure we can analyze them at each use as well. * gcc.dg/graphite/pr84399.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257723 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/graphite-scop-detection.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gcc/graphite-scop-detection.c') diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 43716f18448..70cb773186a 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1027,7 +1027,23 @@ scop_detection::stmt_simple_for_scop_p (sese_l scop, gimple *stmt, case GIMPLE_ASSIGN: case GIMPLE_CALL: - return true; + { + tree op; + ssa_op_iter i; + /* Verify that if we can analyze operands at their def site we + also can represent them when analyzed at their uses. */ + FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_USE) + if (scev_analyzable_p (op, scop) + && !graphite_can_represent_expr (scop, bb->loop_father, op)) + { + DEBUG_PRINT (dp << "[scop-detection-fail] " + << "Graphite cannot represent stmt:\n"; + print_gimple_stmt (dump_file, stmt, 0, + TDF_VOPS | TDF_MEMSYMS)); + return false; + } + return true; + } default: /* These nodes cut a new scope. */ -- cgit v1.2.1