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
5 changed files with 25 additions and 14 deletions
|
@ -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>
|
||||
|
||||
PR target/71270
|
||||
|
|
|
@ -4590,13 +4590,16 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
|
|||
}
|
||||
tree step = fd->loop.step;
|
||||
|
||||
bool is_simt = (safelen_int > 1
|
||||
&& omp_find_clause (gimple_omp_for_clauses (fd->for_stmt),
|
||||
OMP_CLAUSE__SIMT_));
|
||||
tree simt_lane = NULL_TREE, simt_maxlane = NULL_TREE;
|
||||
bool is_simt = omp_find_clause (gimple_omp_for_clauses (fd->for_stmt),
|
||||
OMP_CLAUSE__SIMT_);
|
||||
if (is_simt)
|
||||
{
|
||||
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);
|
||||
gimple *g = gimple_build_call_internal (IFN_GOMP_SIMT_LANE, 0);
|
||||
gimple_call_set_lhs (g, simt_lane);
|
||||
|
|
|
@ -1613,14 +1613,9 @@ public:
|
|||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
virtual bool gate (function *ARG_UNUSED (fun))
|
||||
virtual bool gate (function *fun)
|
||||
{
|
||||
/* FIXME: this should use PROP_gimple_lomp_dev. */
|
||||
#ifdef ACCEL_COMPILER
|
||||
return true;
|
||||
#else
|
||||
return ENABLE_OFFLOADING && (flag_openmp || in_lto_p);
|
||||
#endif
|
||||
return !(fun->curr_properties & PROP_gimple_lomp_dev);
|
||||
}
|
||||
virtual unsigned int execute (function *)
|
||||
{
|
||||
|
|
|
@ -2929,6 +2929,8 @@ dump_properties (FILE *dump, unsigned int props)
|
|||
fprintf (dump, "PROP_rtl\n");
|
||||
if (props & PROP_gimple_lomp)
|
||||
fprintf (dump, "PROP_gimple_lomp\n");
|
||||
if (props & PROP_gimple_lomp_dev)
|
||||
fprintf (dump, "PROP_gimple_lomp_dev\n");
|
||||
if (props & PROP_gimple_lcx)
|
||||
fprintf (dump, "PROP_gimple_lcx\n");
|
||||
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;
|
||||
gcall *call_stmt;
|
||||
unsigned int i;
|
||||
unsigned int prop_mask, src_properties;
|
||||
|
||||
/* The gimplifier uses input_location in too many places, such as
|
||||
internal_get_tmp_var (). */
|
||||
|
@ -4617,11 +4618,13 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
|
|||
id->call_stmt = stmt;
|
||||
|
||||
/* If the src function contains an IFN_VA_ARG, then so will the dst
|
||||
function after inlining. */
|
||||
if ((id->src_cfun->curr_properties & PROP_gimple_lva) == 0)
|
||||
function after inlining. Likewise for IFN_GOMP_USE_SIMT. */
|
||||
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);
|
||||
dst_cfun->curr_properties &= ~PROP_gimple_lva;
|
||||
dst_cfun->curr_properties &= src_properties | ~prop_mask;
|
||||
}
|
||||
|
||||
gcc_assert (!id->src_cfun->after_inlining);
|
||||
|
|
Loading…
Add table
Reference in a new issue