omp-offload: use PROP_gimple_lomp_dev
* omp-expand.c (expand_omp_simd): Clear PROP_gimple_lomp_dev regardless of safelen status. * omp-offload.c (pass_omp_device_lower::gate): Use PROP_gimple_lomp_dev. * passes.c (dump_properties): Handle PROP_gimple_lomp_dev. * tree-inline.c (expand_call_inline): Propagate PROP_gimple_lomp_dev. From-SVN: r244717
This commit is contained in:
parent
8b0fb476f2
commit
4cea867569
|
@ -1,3 +1,11 @@
|
||||||
|
2017-01-20 Alexander Monakov <amonakov@ispras.ru>
|
||||||
|
|
||||||
|
* omp-expand.c (expand_omp_simd): Clear PROP_gimple_lomp_dev regardless
|
||||||
|
of safelen status.
|
||||||
|
* omp-offload.c (pass_omp_device_lower::gate): Use PROP_gimple_lomp_dev.
|
||||||
|
* passes.c (dump_properties): Handle PROP_gimple_lomp_dev.
|
||||||
|
* tree-inline.c (expand_call_inline): Propagate PROP_gimple_lomp_dev.
|
||||||
|
|
||||||
2017-01-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
2017-01-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||||
|
|
||||||
PR target/71270
|
PR target/71270
|
||||||
|
|
|
@ -4590,13 +4590,16 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
|
||||||
}
|
}
|
||||||
tree step = fd->loop.step;
|
tree step = fd->loop.step;
|
||||||
|
|
||||||
bool is_simt = (safelen_int > 1
|
bool is_simt = omp_find_clause (gimple_omp_for_clauses (fd->for_stmt),
|
||||||
&& omp_find_clause (gimple_omp_for_clauses (fd->for_stmt),
|
OMP_CLAUSE__SIMT_);
|
||||||
OMP_CLAUSE__SIMT_));
|
|
||||||
tree simt_lane = NULL_TREE, simt_maxlane = NULL_TREE;
|
|
||||||
if (is_simt)
|
if (is_simt)
|
||||||
{
|
{
|
||||||
cfun->curr_properties &= ~PROP_gimple_lomp_dev;
|
cfun->curr_properties &= ~PROP_gimple_lomp_dev;
|
||||||
|
is_simt = safelen_int > 1;
|
||||||
|
}
|
||||||
|
tree simt_lane = NULL_TREE, simt_maxlane = NULL_TREE;
|
||||||
|
if (is_simt)
|
||||||
|
{
|
||||||
simt_lane = create_tmp_var (unsigned_type_node);
|
simt_lane = create_tmp_var (unsigned_type_node);
|
||||||
gimple *g = gimple_build_call_internal (IFN_GOMP_SIMT_LANE, 0);
|
gimple *g = gimple_build_call_internal (IFN_GOMP_SIMT_LANE, 0);
|
||||||
gimple_call_set_lhs (g, simt_lane);
|
gimple_call_set_lhs (g, simt_lane);
|
||||||
|
|
|
@ -1613,14 +1613,9 @@ public:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/* opt_pass methods: */
|
/* opt_pass methods: */
|
||||||
virtual bool gate (function *ARG_UNUSED (fun))
|
virtual bool gate (function *fun)
|
||||||
{
|
{
|
||||||
/* FIXME: this should use PROP_gimple_lomp_dev. */
|
return !(fun->curr_properties & PROP_gimple_lomp_dev);
|
||||||
#ifdef ACCEL_COMPILER
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return ENABLE_OFFLOADING && (flag_openmp || in_lto_p);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
virtual unsigned int execute (function *)
|
virtual unsigned int execute (function *)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2929,6 +2929,8 @@ dump_properties (FILE *dump, unsigned int props)
|
||||||
fprintf (dump, "PROP_rtl\n");
|
fprintf (dump, "PROP_rtl\n");
|
||||||
if (props & PROP_gimple_lomp)
|
if (props & PROP_gimple_lomp)
|
||||||
fprintf (dump, "PROP_gimple_lomp\n");
|
fprintf (dump, "PROP_gimple_lomp\n");
|
||||||
|
if (props & PROP_gimple_lomp_dev)
|
||||||
|
fprintf (dump, "PROP_gimple_lomp_dev\n");
|
||||||
if (props & PROP_gimple_lcx)
|
if (props & PROP_gimple_lcx)
|
||||||
fprintf (dump, "PROP_gimple_lcx\n");
|
fprintf (dump, "PROP_gimple_lcx\n");
|
||||||
if (props & PROP_gimple_lvec)
|
if (props & PROP_gimple_lvec)
|
||||||
|
|
|
@ -4413,6 +4413,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
|
||||||
bool purge_dead_abnormal_edges;
|
bool purge_dead_abnormal_edges;
|
||||||
gcall *call_stmt;
|
gcall *call_stmt;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
unsigned int prop_mask, src_properties;
|
||||||
|
|
||||||
/* The gimplifier uses input_location in too many places, such as
|
/* The gimplifier uses input_location in too many places, such as
|
||||||
internal_get_tmp_var (). */
|
internal_get_tmp_var (). */
|
||||||
|
@ -4617,11 +4618,13 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
|
||||||
id->call_stmt = stmt;
|
id->call_stmt = stmt;
|
||||||
|
|
||||||
/* If the src function contains an IFN_VA_ARG, then so will the dst
|
/* If the src function contains an IFN_VA_ARG, then so will the dst
|
||||||
function after inlining. */
|
function after inlining. Likewise for IFN_GOMP_USE_SIMT. */
|
||||||
if ((id->src_cfun->curr_properties & PROP_gimple_lva) == 0)
|
prop_mask = PROP_gimple_lva | PROP_gimple_lomp_dev;
|
||||||
|
src_properties = id->src_cfun->curr_properties & prop_mask;
|
||||||
|
if (src_properties != prop_mask)
|
||||||
{
|
{
|
||||||
struct function *dst_cfun = DECL_STRUCT_FUNCTION (id->dst_fn);
|
struct function *dst_cfun = DECL_STRUCT_FUNCTION (id->dst_fn);
|
||||||
dst_cfun->curr_properties &= ~PROP_gimple_lva;
|
dst_cfun->curr_properties &= src_properties | ~prop_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_assert (!id->src_cfun->after_inlining);
|
gcc_assert (!id->src_cfun->after_inlining);
|
||||||
|
|
Loading…
Reference in New Issue