On 10/20/2015 08:34 PM, Alexander Monakov wrote:
(note to reviewers: I'm not sure what we're after here, on the high level;
will be happy to rework the patch in a saner manner based on feedback, or even
drop it for now)
At the moment the attribute setting logic in omp-low.c is such that if a
function that should be present in target code does not already have 'omp
declare target' attribute, it receives 'omp target entrypoint'. That is
wasteful: clearly not all user-declared target functions will be target region
entry points in OpenMP.
The motivating example for this change is OpenMP parallel target regions. The
'parallel' part is outlined into its own function. We don't want that
function be an 'entrypoint' on PTX (but only as a matter of optimality rather
than correctness).
* omp-low.c (create_omp_child_function): Set "omp target entrypoint"
or "omp declare target" attribute based on is_gimple_omp_offloaded.
I think this looks reasonable, but you might want to adjust it in
whatever way is necessary so that you can drop patch 1/14.
Bernd