diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-10 16:13:17 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-10 16:13:17 +0000 |
commit | c8ebeb0e3c6b093e649592be7d51d1c0032a1dc7 (patch) | |
tree | bb832c8ec1fee906061fa6f7a5fa3fb4e910d68c /gcc/graphite-scop-detection.c | |
parent | d254eda348d5b037f433a3525bdd635e9ee07561 (diff) | |
download | gcc-c8ebeb0e3c6b093e649592be7d51d1c0032a1dc7.tar.gz |
2016-02-10 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with more of GCC 6, using
svn merge -r225091:227000 ^/trunk }}
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@233280 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r-- | gcc/graphite-scop-detection.c | 80 |
1 files changed, 70 insertions, 10 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 686f4956e1e..b2a4aafdaa0 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -51,13 +51,14 @@ along with GCC; see the file COPYING3. If not see #include "graphite-poly.h" #include "tree-ssa-propagate.h" #include "graphite-scop-detection.h" +#include "gimple-pretty-print.h" /* Forward declarations. */ static void make_close_phi_nodes_unique (basic_block); /* The type of the analyzed basic block. */ -typedef enum gbb_type { +enum gbb_type { GBB_UNKNOWN, GBB_LOOP_SING_EXIT_HEADER, GBB_LOOP_MULT_EXIT_HEADER, @@ -65,7 +66,7 @@ typedef enum gbb_type { GBB_COND_HEADER, GBB_SIMPLE, GBB_LAST -} gbb_type; +}; /* Detect the type of BB. Loop headers are only marked, if they are new. This means their loop_father is different to LAST_LOOP. @@ -127,7 +128,7 @@ get_bb_type (basic_block bb, struct loop *last_loop) 9 <- exit */ -typedef struct sd_region_p +struct sd_region { /* The entry bb dominates all bbs in the sd_region. It is part of the region. */ @@ -136,7 +137,7 @@ typedef struct sd_region_p /* The exit bb postdominates all bbs in the sd_region, but is not part of the region. */ basic_block exit; -} sd_region; +}; @@ -350,13 +351,31 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop, || (gimple_code (stmt) == GIMPLE_CALL && !(gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE))) || (gimple_code (stmt) == GIMPLE_ASM)) - return false; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "Graphite cannot handle this stmt:\n"); + print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); + } + + return false; + } if (is_gimple_debug (stmt)) return true; if (!stmt_has_simple_data_refs_p (outermost_loop, stmt)) - return false; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "Graphite cannot handle data-refs in stmt:\n"); + print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); + } + + return false; + } switch (gimple_code (stmt)) { @@ -375,7 +394,16 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop, || code == GE_EXPR || code == EQ_EXPR || code == NE_EXPR)) - return false; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "Graphite cannot handle cond stmt:\n"); + print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); + } + + return false; + } for (unsigned i = 0; i < 2; ++i) { @@ -383,7 +411,16 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop, if (!graphite_can_represent_expr (scop_entry, loop, op) /* We can not handle REAL_TYPE. Failed for pr39260. */ || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE) - return false; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "Graphite cannot represent stmt:\n"); + print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); + } + + return false; + } } return true; @@ -395,6 +432,12 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop, default: /* These nodes cut a new scope. */ + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "Gimple stmt not handled in Graphite:\n"); + print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS|TDF_MEMSYMS); + } return false; } @@ -488,7 +531,16 @@ scopdet_basic_block_info (basic_block bb, loop_p outermost_loop, with make_forwarder_block. */ if (!single_succ_p (bb) || bb_has_abnormal_pred (single_succ (bb))) - result.difficult = true; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "BB %d cannot be part of a scop.\n", + bb->index); + } + + result.difficult = true; + } else result.exit = single_succ (bb); @@ -509,7 +561,15 @@ scopdet_basic_block_info (basic_block bb, loop_p outermost_loop, sinfo = build_scops_1 (bb, outermost_loop, ®ions, loop); if (!graphite_can_represent_loop (entry_block, loop)) - result.difficult = true; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "[scop-detection-fail] "); + fprintf (dump_file, "Graphite cannot represent loop %d.\n", + loop->num); + } + result.difficult = true; + } result.difficult |= sinfo.difficult; |