Commit 9ece21a6 by Martin Jambor Committed by Martin Jambor

[omp, hsa] Do not gridify simd constructs

2016-02-26  Martin Jambor  <mjambor@suse.cz>

	* omp-low.c (grid_find_ungridifiable_statement): Store problematic
	statements to wi->info.  Also disallow omp simd constructs.
	(grid_target_follows_gridifiable_pattern): Use wi.info to dump reason
	for not gridifying.  Dump special string for omp_for.

From-SVN: r233746
parent 6cfccbb2
2016-02-26 Martin Jambor <mjambor@suse.cz>
* omp-low.c (grid_find_ungridifiable_statement): Store problematic
statements to wi->info. Also disallow omp simd constructs.
(grid_target_follows_gridifiable_pattern): Use wi.info to dump reason
for not gridifying. Dump special string for omp_for.
2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2016-02-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/69245 PR target/69245
......
...@@ -17241,7 +17241,7 @@ grid_find_single_omp_among_assignments (gimple_seq seq, location_t target_loc, ...@@ -17241,7 +17241,7 @@ grid_find_single_omp_among_assignments (gimple_seq seq, location_t target_loc,
static tree static tree
grid_find_ungridifiable_statement (gimple_stmt_iterator *gsi, grid_find_ungridifiable_statement (gimple_stmt_iterator *gsi,
bool *handled_ops_p, bool *handled_ops_p,
struct walk_stmt_info *) struct walk_stmt_info *wi)
{ {
*handled_ops_p = false; *handled_ops_p = false;
gimple *stmt = gsi_stmt (*gsi); gimple *stmt = gsi_stmt (*gsi);
...@@ -17251,6 +17251,7 @@ grid_find_ungridifiable_statement (gimple_stmt_iterator *gsi, ...@@ -17251,6 +17251,7 @@ grid_find_ungridifiable_statement (gimple_stmt_iterator *gsi,
if (gimple_call_noreturn_p (as_a <gcall *> (stmt))) if (gimple_call_noreturn_p (as_a <gcall *> (stmt)))
{ {
*handled_ops_p = true; *handled_ops_p = true;
wi->info = stmt;
return error_mark_node; return error_mark_node;
} }
break; break;
...@@ -17266,8 +17267,19 @@ grid_find_ungridifiable_statement (gimple_stmt_iterator *gsi, ...@@ -17266,8 +17267,19 @@ grid_find_ungridifiable_statement (gimple_stmt_iterator *gsi,
case GIMPLE_OMP_TARGET: case GIMPLE_OMP_TARGET:
case GIMPLE_OMP_ORDERED: case GIMPLE_OMP_ORDERED:
*handled_ops_p = true; *handled_ops_p = true;
wi->info = stmt;
return error_mark_node; return error_mark_node;
case GIMPLE_OMP_FOR:
if ((gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD)
&& gimple_omp_for_combined_into_p (stmt))
{
*handled_ops_p = true;
wi->info = stmt;
return error_mark_node;
}
break;
default: default:
break; break;
} }
...@@ -17509,10 +17521,11 @@ grid_target_follows_gridifiable_pattern (gomp_target *target, tree *group_size_p ...@@ -17509,10 +17521,11 @@ grid_target_follows_gridifiable_pattern (gomp_target *target, tree *group_size_p
struct walk_stmt_info wi; struct walk_stmt_info wi;
memset (&wi, 0, sizeof (wi)); memset (&wi, 0, sizeof (wi));
if (gimple *bad = walk_gimple_seq (gimple_omp_body (gfor), if (walk_gimple_seq (gimple_omp_body (gfor),
grid_find_ungridifiable_statement, grid_find_ungridifiable_statement,
NULL, &wi)) NULL, &wi))
{ {
gimple *bad = (gimple *) wi.info;
if (dump_enabled_p ()) if (dump_enabled_p ())
{ {
if (is_gimple_call (bad)) if (is_gimple_call (bad))
...@@ -17520,6 +17533,11 @@ grid_target_follows_gridifiable_pattern (gomp_target *target, tree *group_size_p ...@@ -17520,6 +17533,11 @@ grid_target_follows_gridifiable_pattern (gomp_target *target, tree *group_size_p
"Will not turn target construct into a gridified " "Will not turn target construct into a gridified "
" GPGPU kernel because the inner loop contains " " GPGPU kernel because the inner loop contains "
"call to a noreturn function\n"); "call to a noreturn function\n");
if (gimple_code (bad) == GIMPLE_OMP_FOR)
dump_printf_loc (MSG_NOTE, tloc,
"Will not turn target construct into a gridified "
" GPGPU kernel because the inner loop contains "
"a simd construct\n");
else else
dump_printf_loc (MSG_NOTE, tloc, dump_printf_loc (MSG_NOTE, tloc,
"Will not turn target construct into a gridified " "Will not turn target construct into a gridified "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment