public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/106752] New: [OpenMP] reverse offload – avoid emitting 'nohost' variant on the host / cleanup
Date: Fri, 26 Aug 2022 10:26:14 +0000	[thread overview]
Message-ID: <bug-106752-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106752

            Bug ID: 106752
           Summary: [OpenMP] reverse offload – avoid emitting 'nohost'
                    variant on the host / cleanup
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

For reverse offload, GCC generates a
  <...>._omp_fn.0.nohost
function on all devices and on the host it also generates
  <...>._omp_fn.0

However, the 'nohost' version is not used on the host and could be removed.
(Cleanup + size optimization.) - Or in other words:


(Pre-remark: DECL_IGNORE_P is set in omp-expand.cc's expand_omp_target
while the quote below is from omp-offload.cc execute_omp_device_lower.)

From https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600387.html:

> +	  case IFN_GOMP_TARGET_REV:
...
> +	      /* FIXME: Find a way to actually prevent outputting the empty-body
> +		 old_decl as debug symbol + function in the assembly file.  */

The debug stuff ought to be through DECL_IGNORED_P on the FUNCTION_DECL.
If you want it set just on one side and clear on the other side, perhaps set
or clear it during lto streaming it in in offload lto1?

As for emitting it, perhaps turning it into an external declaration from
definition afterwards?


Cf. also original patch:
  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598662.html
albeit the longer description is in
  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598654.html

This patch was committed as r13-2218.

                 reply	other threads:[~2022-08-26 10:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106752-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).