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.129.124]) by sourceware.org (Postfix) with ESMTPS id 20A8B3857C7E for ; Wed, 14 Sep 2022 12:54:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20A8B3857C7E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663160040; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=E+XjkwT+RDjXrbFltwAIfJAetC3NOeMSmWmm8kUzy0A=; b=RfBqKyuWQAq/Cos/BkbbFFE9N9rJEs9hb92J2IEAzRk9hu/Z7+tk0OvMcf2k6nByByO7f2 ljgfpf02YCe8xwlBMDw4+XuGzN324GnBAfQv7jsil8n5JQOcu6/h8SF5BJIfufuF9HyWn8 75COiUdDxIo3WqXEV9NLqOZ7npjT1nM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-407-_bXz8g7sOCuvHC2bq7uBNg-1; Wed, 14 Sep 2022 08:53:58 -0400 X-MC-Unique: _bXz8g7sOCuvHC2bq7uBNg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A0ED87B2A6; Wed, 14 Sep 2022 12:53:58 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09D8549BB61; Wed, 14 Sep 2022 12:53:57 +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 28ECrteq1975959 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 14 Sep 2022 14:53:55 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28ECrsxd1975957; Wed, 14 Sep 2022 14:53:54 +0200 Date: Wed, 14 Sep 2022 14:53:54 +0200 From: Jakub Jelinek To: Julian Brown Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, tobias@codesourcery.com, cltang@codesourcery.com Subject: Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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=-4.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Tue, Sep 13, 2022 at 02:03:16PM -0700, Julian Brown wrote: > @@ -3440,6 +3437,50 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, > { > if (pointer || (openacc && allocatable)) > { > + gfc_omp_namelist *n2 > + = openacc ? NULL : clauses->lists[OMP_LIST_MAP]; > + > + /* If the last reference is a pointer to a derived > + type ("foo%dt_ptr"), check if any subcomponents > + of the same derived type member are being mapped > + elsewhere in the clause list ("foo%dt_ptr%x", > + etc.). If we have such subcomponent mappings, > + we only create an ALLOC node for the pointer > + itself, and inhibit mapping the whole derived > + type. */ > + > + for (; n2 != NULL; n2 = n2->next) > + { > + if (n == n2 || !n2->expr) > + continue; > + > + int dep > + = gfc_dep_resolver (n->expr->ref, n2->expr->ref, > + NULL, true); > + if (dep == 0) > + continue; Isn't this and the other loop quadratic compile time in number of clauses? Could it be done linearly through some perhaps lazily built hash table or something similar? Jakub