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 ESMTPS id 3BBBF3858422 for ; Thu, 22 Sep 2022 13:17:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3BBBF3858422 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=1663852634; 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=EWUMOoLpZULrPpWm5FZel/1PKQ+ph81seqdEnTSIanM=; b=cOIGOmt+UkJDk3nwR82RuYjEfnY77VslM4kYMYLQkas+yMpW9xmPybHvf+HuGpvPPbh+1W /gYifBbZsMfB/ZWzRjjvUgx+eIsLUin/KQSoWZtMR0/EODcfnFZ0BYrb5hOqmI5BPObPfA 01PUhQeDqYqm6xsgm5s/sauwReCNXLs= 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-412--HS50n9hN3aR2D4CEky55w-1; Thu, 22 Sep 2022 09:17:13 -0400 X-MC-Unique: -HS50n9hN3aR2D4CEky55w-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 25A3987B2A3; Thu, 22 Sep 2022 13:17:13 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D97154B4010; Thu, 22 Sep 2022 13:17:12 +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 28MDHAGi2547411 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 15:17:10 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28MDH9Bb2547410; Thu, 22 Sep 2022 15:17:09 +0200 Date: Thu, 22 Sep 2022 15:17:08 +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: <20220918201929.60a6282e@squid.athome> MIME-Version: 1.0 In-Reply-To: <20220918201929.60a6282e@squid.athome> 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 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 Sun, Sep 18, 2022 at 08:19:29PM +0100, Julian Brown wrote: > @@ -2609,6 +2672,9 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, > if (clauses == NULL) > return NULL_TREE; > > + hash_map sym_rooted_nl; Isn't hash_map ctor pretty costly (allocates memory etc.)? And gfc_trans_omp_clauses is called for all OpenMP constructs, in many cases they are never going to have any map clauses or even if they do, they might not trigger this code. > + bool built_sym_hash = false; So, I think usually we don't construct such hash_maps right away, but have just pointer to the hash map initialized to NULL (then you don't need to built_sym_hash next to it) and you simply new the hash_map when needed the first time and delete it at the end (which does nothing if it is NULL). Jakub