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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 8155E3858D20 for ; Sat, 10 Aug 2024 08:02:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8155E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8155E3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723276945; cv=none; b=ZsBl39CEbRANO4CMtNouAgk2W2gPLcEO0Yvn6fFCtdQywfU28XLNS52gjikKjuAzNiqQbIrDjQjzyLA73YVfZhrrLGQCS2hKQP/OBH93bAQZztoobrp6VcRgCTDmdolGdzRZMdz69aNNxqpuIfWo3PTQ3lxf6ZxlXQ7xWvNvkKU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723276945; c=relaxed/simple; bh=ZTaArRYaSWzVz/2IJU5y3itUyEBhr6VBELqZFJk+BRE=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ANsF5iCMxUDC96tPyfVDXtwj0dLGwK4QvODOrBF+mcN8yu4wQyW/mzauVvFrRZ7szL8r1Bj1lJheYpBsM293S8S81Qlj1DNLLrdZFt0XSA3FpcE0PCbwOUHgNgiJRjEGCL5QRni2/Y2fR7I4Wjw1DF7JAH16nQW2nGj4YfkiKJ8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723276936; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=4Mb83c3lZkjbX5AuIYFhOgHh0SKXD6stXG+j/YCqS4I=; b=XQcGynhSevo2XNM7JZs1kHi9mN+AGBwt5rVtI/FWBg3KPGqnOUg6BBA84/y/LB7jSf0+vy g+YqFDikWjw/g6Kl3eoe0vTCF5KLdJOiUcQjbXqzac3T7i6XgcLdK+iYgPfU82+GML2J2B IvsdvcpeDyQL6MA99arRZV9nsckODLQ= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-jb91-mKWMdeWi-tkRjgwBw-1; Sat, 10 Aug 2024 04:02:14 -0400 X-MC-Unique: jb91-mKWMdeWi-tkRjgwBw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B133F19560B1; Sat, 10 Aug 2024 08:02:12 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.25]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C93CE19560A3; Sat, 10 Aug 2024 08:02:11 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 47A829bQ2972116 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 10 Aug 2024 10:02:09 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 47A828cU2972115; Sat, 10 Aug 2024 10:02:08 +0200 Date: Sat, 10 Aug 2024 10:02:08 +0200 From: Jakub Jelinek To: Sandra Loosemore , gcc-patches@gcc.gnu.org, tburnus@baylibre.com Subject: Re: [PATCH v3 02/12] OpenMP: middle-end support for metadirectives Message-ID: Reply-To: Jakub Jelinek References: <20240720204231.2229891-1-sloosemore@baylibre.com> <20240720204231.2229891-3-sloosemore@baylibre.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Aug 10, 2024 at 09:18:24AM +0200, Jakub Jelinek wrote: > On Fri, Aug 09, 2024 at 07:12:48PM +0200, Jakub Jelinek wrote: > > > --- a/gcc/gimple.def > > > +++ b/gcc/gimple.def > > > @@ -398,6 +398,13 @@ DEFGSCODE(GIMPLE_OMP_TEAMS, "gimple_omp_teams", GSS_OMP_PARALLEL_LAYOUT) > > > CLAUSES is an OMP_CLAUSE chain holding the associated clauses. */ > > > DEFGSCODE(GIMPLE_OMP_ORDERED, "gimple_omp_ordered", GSS_OMP_SINGLE_LAYOUT) > > > > > > +/* GIMPLE_OMP_METADIRECTIVE represents #pragma omp metadirective. */ > > > +DEFGSCODE(GIMPLE_OMP_METADIRECTIVE, "gimple_omp_metadirective", > > > + GSS_OMP_METADIRECTIVE) > > > + > > > +DEFGSCODE(GIMPLE_OMP_METADIRECTIVE_VARIANT, > > > + "gimple_omp_variant", GSS_OMP_METADIRECTIVE_VARIANT) > > > + > > Oh, and I wonder if there shouldn't be a different representation of this in > GIMPLE. > GIMPLE_OMP_METADIRECTIVE in the patch seems to have both the TREE_LISTs for > the variants and the labels. > We already have a construct which can have a set of labels, GIMPLE_SWITCH, > and tons of optimizations available for it. > Can't GIMPLE_OMP_METADIRECTIVE be just the list of TREE_LISTs for the > variants which sets some integer SSA_NAME with a GIMPLE_SWITCH next to it > which picks what code will be used? And, to simplify the SSA scanners, > perhaps have the device_num and condition operands hoisted to separate ops. > So, ops[0] would be the output, artificial integer result used in > GIMPLE_SWITCH, ops[1] say condition SSA_NAME (if dynamic condition isn't > used, then boolean_true_node), ops[2] say device_num SSA_NAME (if unused > some negative INTEGER_CST which can't otherwise happen)? > Perhaps we'd want to avoid GIMPLE_SWITCH lowering if the controlling > SSA_NAME has GIMPLE_OMP_METADIRECTIVE def_stmt (because we expect it to > fold into a constant), but otherwise other GIMPLE_SWITCH optimizations might > be ok. > > What do you think? Or am I missing something? Please ignore the part about dynamic condition/device_num, each variant obviously will have its own. But the rest stands. Jakub