[Patch][RFC] openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551) (was: Re: [Patch][RFC] openmp: don't add artificial const decl to offload table (PRs 94848 + 95551))

Tobias Burnus tobias@codesourcery.com
Mon Jun 8 19:36:29 GMT 2020


Hi Jakub,

On 6/8/20 5:30 PM, Jakub Jelinek wrote:

> I really don't see what is special exactly on TREE_READONLY DECL_ARTIFICIAL

I have now split-off the missed-optimization task to a new
PR, PR95583, to be handled in a proper way instead of trying
to cook-up a hackish special-case version.

This patch now simply sets the force_output flag.

(a) As output_offload_tables() (i.e. LTO streamout)
     comes very early, one could just set the force_output flag
     in this file without further checks or omp-offload.c changes
(b) Alternatively, one check that it really works by using
       gcc_assert (symtab_node::get (it));
     in either or both files.
(c) or assuming that some optimization worked, one could use:
   if (!symtab_node::get (it))
     continue;

The patch does (c) as trimming it to (b) or (a) is trival.

All should give currently the same result; the assert checks
for this, the "if (...)" is future-optimizations proof, but
I fear that before adding passes before output_offload_tables()
it makes no difference. (→new PR).

(The omp_finish_file comes late enough, but as the LTO has been
written before, it does not help.)

OK? What about backporting to GCC 10?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-offload-skip-v5.diff
Type: text/x-patch
Size: 4346 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200608/fcd612cd/attachment.bin>


More information about the Gcc-patches mailing list