public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>,
	Richard Biener <rguenther@suse.de>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: [Patch] Add 'default' to -foffload=; document that flag [PR67300]
Date: Thu, 17 Jun 2021 21:40:10 +0200	[thread overview]
Message-ID: <20210617194010.GJ7746@tucnak> (raw)
In-Reply-To: <07d9e298-55d0-0e80-84f5-5d5d75c9e341@codesourcery.com>

On Thu, Jun 17, 2021 at 09:28:00PM +0200, Tobias Burnus wrote:
> I am not sure whether I fully agree with this or not. However:
> 
> Let's propose something radical, which probably won't break any real-world
> code, avoids the need to add a new -foffload=<something> keyword and is
> also intuitive to the user:
> 
> * -foffload=<target triplet list>=-option
> 
> Suggestion: This no longer affects the list of enabled targets. As by default
> all targets are enabled, this one will (kept) be(en) enabled (but might
> silently fail if the target lto1 is not installed).
> 
> * -foffload=disable  and -foffload=<triplet-list>
> 
> This is the only way to modify the list of supported offload devices to those
> specified. By adding a triplet explicitly, it will give an error via lto1.
> 
> That will solve all issues, possibly except for
>   -foffload=-lm -foffload=nxpt-none=-latomic -foffload=amdgcn-amdhsa
> some might find it surprising that nvptx offloading will be disabled,
> but others might find it natural.

Could we introduce a different option which wouldn't imply enabling that
target:
-foffload-options=<target triplet list>=option
and make
-foffload=<target triplet list>=option
imply (expand in the driver)
-foffload-options=<target triplet list>=option -foffload=<target triplet list>
?
That would be mostly backwards compatible, but would allow users to specify options
separately from the enabled target list.
The <target triplet list> in the above cases couldn't include disable or
default, but the -foffload=<target triplet list> case could, and disable
(either in the list or separately) would simply disable all targets (even
those enabled earlier), while default would reset the list to the default
(basically cancel all previous non-options -foffload= options).
And the -foffload-options= would accumulate in the order given on the
command line.

	Jakub


  reply	other threads:[~2021-06-17 19:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 12:08 Tobias Burnus
2021-06-17 12:27 ` Jakub Jelinek
2021-06-17 16:03   ` Tobias Burnus
2021-06-17 17:41     ` Sandra Loosemore
2021-06-17 17:50       ` Jakub Jelinek
2021-06-17 19:28         ` Tobias Burnus
2021-06-17 19:40           ` Jakub Jelinek [this message]
2021-06-17 21:57             ` Sandra Loosemore
2021-06-17 23:05               ` Tobias Burnus
2021-06-18 22:47                 ` Sandra Loosemore
2021-06-28 11:28                   ` Tobias Burnus
2021-06-28 15:51                     ` Tobias Burnus
2021-06-28 22:34                       ` Sandra Loosemore
2021-06-29 11:58                       ` Jakub Jelinek
2021-06-29 13:47                         ` Tobias Burnus
2021-06-29 13:51                           ` Jakub Jelinek
2021-06-29 20:47                           ` Rainer Orth
2021-06-29 21:02                             ` Christophe Lyon
2021-06-30 20:12                             ` Rainer Orth

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=20210617194010.GJ7746@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=sandra@codesourcery.com \
    --cc=thomas@codesourcery.com \
    --cc=tobias@codesourcery.com \
    /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).