From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 132193853D58 for ; Fri, 18 Nov 2022 20:06:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 132193853D58 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x632.google.com with SMTP id g10so5473717plo.11 for ; Fri, 18 Nov 2022 12:06:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oc3ivrL9eXPrRarh4Oq4D1J68NMOajqKMUOg3a+wswc=; b=aO4c6deemZ1PZtYhJUBX8mG1+7Mzzen5WM8rL/fvUg7MWTC0EAqjYTP2CCAkqoLn1D mdJrKhFpGPixz70uHNH7OFS24NDhgF0FbyKyyPaZvb4hbMSIqG3t2aZTk5BWlIdMZpni wG+Oxc294RrC/fTDTUjnPlkopIzAG3fsxnGyoaL4oFdOkNstMNgF7Tyi39W4oTnSoTP5 o+3epMOihc64pKDyXnRWnc/+j5R7cw9axdwaD4oaSh0gBc8HIJyZm+SAXnKnQXGbA9gw Hm95ow4Sui9085aQcyt+giJnv9SIjJNuNws6izOVD/FGbaw0t+E4yw+GX2N0fmNgxXDl 11kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oc3ivrL9eXPrRarh4Oq4D1J68NMOajqKMUOg3a+wswc=; b=PeEBqEqJad7iJUHNpTURtoRBJ+qstaTnzaKV+fOO/1Wom42sjfncLaC284ia0dHJtf d/RR/b3Ct+4JKsD0d1+DO0NJ2Ae0ApGiGpqigoHlHcJKcRAcH8lBYJEdNjbpSCW3d8Bp 5dZ4rX84qiuKUFvCdSNlzUYZHKVolgNaXQh4SLdII5bXW0amReCmC9gmxCHwMqILV5do z0c6Np0vOzgV+Kda38R206/eVAj5ybIS87ELLOWx2e5/w+NXN+ShsO3f7SbevGtEc1Kv VzY+HW+LvBajbufO5UqzSAfdqVD6/C3zCo4q7C1Vdo7EjhQvoWe63DKwb0yKSggYzIjA janQ== X-Gm-Message-State: ANoB5plM93MfgeZNe/Xjj+h2HfMohsZzEbnCA4R/gjK+DskeEejmnMyC gTgxdfW7wGui2ZbIYN5OW9c= X-Google-Smtp-Source: AA0mqf7VnR2ZXZu1WvNPZvbD7rtPAVBJn8kXrbDnrLcLXDEYof0AFb9XXFr19aJRevI31V4VvfhfDQ== X-Received: by 2002:a17:902:d882:b0:187:3d00:7ca4 with SMTP id b2-20020a170902d88200b001873d007ca4mr988942plz.135.1668801964895; Fri, 18 Nov 2022 12:06:04 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id j7-20020a17090a7e8700b0020dc318a43esm3181649pjl.25.2022.11.18.12.06.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 12:06:04 -0800 (PST) Message-ID: <337e91f6-e8ad-3a45-cb94-9093cd33c6e9@gmail.com> Date: Fri, 18 Nov 2022 13:06:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] constexprify some tree variables Content-Language: en-US To: apinski@marvell.com, gcc-patches@gcc.gnu.org References: <1668794731-9349-1-git-send-email-apinski@marvell.com> From: Jeff Law In-Reply-To: <1668794731-9349-1-git-send-email-apinski@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 11/18/22 11:05, apinski--- via Gcc-patches wrote: > From: Andrew Pinski > > Since we use C++11 by default now, we can > use constexpr for some const decls in tree-core.h. > > This patch does that and it allows for better optimizations > of GCC code with checking enabled and without LTO. > > For an example generic-match.cc compiling is speed up due > to the less number of basic blocks and less debugging info > produced. I did not check the speed of compiling the same source > but rather the speed of compiling the old vs new sources here > (but with the same compiler base). > > The small slow down in the parsing of the arrays in each TU > is migrated by a speed up in how much code/debugging info > is produced in the end. > > Note I looked at generic-match.cc since it is one of the > compiling sources which causes parallel building to stall and > I wanted to speed it up. > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > Or should this wait until GCC 13 branches off? > > gcc/ChangeLog: > > PR middle-end/14840 > * tree-core.h (tree_code_type): Constexprify > by including all-tree.def. > (tree_code_length): Likewise. > * tree.cc (tree_code_type): Remove. > (tree_code_length): Remove. I would have preferred this a week ago :-)   And if it was just const-ifying, I'd ACK it without hesitation. Can you share any of the build-time speedups you're seeing, even if they're not perfect.  It'd help to get a sense of the potential gain here and whether or not there's enough gain to gate it into gcc-13 or have it wait for gcc-14. And if we can improve the compile-time of the files generated by match.pd, that's a win.  It's definitely a serialization point -- it becomes *painfully* obvious when doing a bootstrap using qemu, when that file takes 1-2hrs after everything else has finished. Jeff