From patchwork Thu Nov 21 08:22:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1198816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514281-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Tphv18eQ"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47JXbz051kz9s7T for ; Thu, 21 Nov 2019 19:22:22 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=qp7/MfYfTcuPLlFmeDRQpYFuQDYPCtSt6KbwJ3tz55cegkGRm3Vdi T5c6U1qlOwzECLV2oJrb6McR4efqgDtWGAEpriDbMKehKIsqDSV0S5f1Qrc1wZ7U oNjd1kIZ0IlYBfHp/Km5CRXFJoRI/n+VJb/uK++YzYK9F9fFGDGImw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=YgcvqaBMscp0hW2CaE/2pVUQ1t4=; b=Tphv18eQeVem77UXYEmu njwNhjhEdCv+YoN0c0Eee4H1x9d8sLPUUJ3W1XuBajvJNd6pcgUpiW5US+YpTX2M Drh0HZdVJjrvawigVSmCjXj2ASV9Bi6raf96NFSf3R0ebp0uVZ2fT5sECNZ2k7V+ yS3hg8mdQkvi0uwTPUUq1Sk= Received: (qmail 44692 invoked by alias); 21 Nov 2019 08:22:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 44680 invoked by uid 89); 21 Nov 2019 08:22:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Nov 2019 08:22:15 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F0991AF21 for ; Thu, 21 Nov 2019 08:22:12 +0000 (UTC) Date: Thu, 21 Nov 2019 09:22:12 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Use an obstack for PTA equiv class hashes Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2019-11-21 Richard Biener * tree-ssa-structalias.c (equiv_class_hasher): Change to nofree. (equiv_class_obstack): New. (equiv_class_lookup_or_add): Allocate from equiv_class_obstack. (perform_var_substitution): Initialize equiv_class_obstack. (free_var_substitution_info): Free equiv_class_obstack. Index: gcc/tree-ssa-structalias.c =================================================================== --- gcc/tree-ssa-structalias.c (revision 278496) +++ gcc/tree-ssa-structalias.c (working copy) @@ -1911,7 +1911,7 @@ typedef const struct equiv_class_label * /* Equiv_class_label hashtable helpers. */ -struct equiv_class_hasher : free_ptr_hash +struct equiv_class_hasher : nofree_ptr_hash { static inline hashval_t hash (const equiv_class_label *); static inline bool equal (const equiv_class_label *, @@ -1944,6 +1944,8 @@ static hash_table *p classes. */ static hash_table *location_equiv_class_table; +struct obstack equiv_class_obstack; + /* Lookup a equivalence class in TABLE by the bitmap of LABELS with hash HAS it contains. Sets *REF_LABELS to the bitmap LABELS is equivalent to. */ @@ -1960,7 +1962,7 @@ equiv_class_lookup_or_add (hash_tablefind_slot (&ecl, INSERT); if (!*slot) { - *slot = XNEW (struct equiv_class_label); + *slot = XOBNEW (&equiv_class_obstack, struct equiv_class_label); (*slot)->labels = labels; (*slot)->hashcode = ecl.hashcode; (*slot)->equivalence_class = 0; @@ -2334,6 +2336,7 @@ perform_var_substitution (constraint_gra scc_info *si = new scc_info (size); bitmap_obstack_initialize (&iteration_obstack); + gcc_obstack_init (&equiv_class_obstack); pointer_equiv_class_table = new hash_table (511); location_equiv_class_table = new hash_table (511); @@ -2473,6 +2476,7 @@ free_var_substitution_info (class scc_in pointer_equiv_class_table = NULL; delete location_equiv_class_table; location_equiv_class_table = NULL; + obstack_free (&equiv_class_obstack, NULL); bitmap_obstack_release (&iteration_obstack); }