+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
}
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);
{}
/* 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 *)
{
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)
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 (). */
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);