From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 8AA05398E442 for ; Thu, 17 Jun 2021 19:40:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8AA05398E442 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-471-a2I_0M_LP_SZ_7Zwz80viw-1; Thu, 17 Jun 2021 15:40:17 -0400 X-MC-Unique: a2I_0M_LP_SZ_7Zwz80viw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FF1B10068F5; Thu, 17 Jun 2021 19:40:16 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-115-161.ams2.redhat.com [10.36.115.161]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B2255D6D7; Thu, 17 Jun 2021 19:40:14 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 15HJeBe1081111 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 21:40:12 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 15HJeAPL081110; Thu, 17 Jun 2021 21:40:10 +0200 Date: Thu, 17 Jun 2021 21:40:10 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: Sandra Loosemore , Richard Biener , gcc-patches , Thomas Schwinge Subject: Re: [Patch] Add 'default' to -foffload=; document that flag [PR67300] Message-ID: <20210617194010.GJ7746@tucnak> Reply-To: Jakub Jelinek References: <1587c151-b99f-2f44-3044-7b01c296b9ad@codesourcery.com> <20210617122737.GE7746@tucnak> <20210617175054.GI7746@tucnak> <07d9e298-55d0-0e80-84f5-5d5d75c9e341@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <07d9e298-55d0-0e80-84f5-5d5d75c9e341@codesourcery.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 19:40:22 -0000 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= keyword and is > also intuitive to the user: > > * -foffload==-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= > > 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==option and make -foffload==option imply (expand in the driver) -foffload-options==option -foffload= ? That would be mostly backwards compatible, but would allow users to specify options separately from the enabled target list. The in the above cases couldn't include disable or default, but the -foffload= 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