From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 827B83857806 for ; Wed, 16 Mar 2022 12:53:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 827B83857806 Received: by mail-ej1-x62d.google.com with SMTP id a8so3943839ejc.8 for ; Wed, 16 Mar 2022 05:53:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wfTTcR3+Vqnbexw/nj9vevZ2yolNW+8SLcIfPRoV8Fo=; b=zkJZfgoAy6Y2/0z6wRiD+jZ3Or9PAiKfW+PUWqXN0dU+J54sPTeT8vRCfAaES6X3nl gWseE+3jqkD2bYJit0Ak8N0xHEz9furrZO6FHs/FJ1DcK8Ho8sSXaYE6JchbOm+8d0rx e7OevZf8zG9hMEwMIw0Q2OSODyqOTbadyPEDEYPya9KrveXmKPrYd05y9cqIfLuSiO5d InUKJqx2pST142JgutOxHxdHbd4aSEvcO07qlzF/V/mMbcJOl4VRUoaNmtfVhC5Q0hXP w+Rthq3z7WtWWN/ldUJuOC7NrmQsurtnaCv8zkVBSk+VQI7BTn73giGKjNBi6Oaqulgk uJVA== X-Gm-Message-State: AOAM533n6yBQheVEDehh2GkGdOT5nwnrCD4FBfvSR+2LD++yAtIa2NgL F2q49NlihB+suOEdq48Ha0bt/fjmjUxtQ5TSuwogNH1b X-Google-Smtp-Source: ABdhPJwtjbcWnykArXvctoynHwJHyZSulXR69g34OOzkjZncKTvamQx4WtT93tCo3CVBDszAtRxfZ2wldeyIlpoaQ0k= X-Received: by 2002:a17:906:4108:b0:6db:6b07:34c3 with SMTP id j8-20020a170906410800b006db6b0734c3mr27960853ejk.407.1647435230996; Wed, 16 Mar 2022 05:53:50 -0700 (PDT) MIME-Version: 1.0 References: <001001d83931$3defb510$b9cf1f30$@nextmovesoftware.com> In-Reply-To: <001001d83931$3defb510$b9cf1f30$@nextmovesoftware.com> From: Richard Biener Date: Wed, 16 Mar 2022 13:53:40 +0100 Message-ID: Subject: Re: [PATCH] Generate an if instead of a switch with one case in genmatch. To: Roger Sayle Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 12:53:54 -0000 On Wed, Mar 16, 2022 at 1:28 PM Roger Sayle wrote: > > > This patch is the first of two changes to genmatch that don't affect > the executable code, but reduce the amount of debugging information > generated in stage3 of a build, but adhering more closely to GNU style > guidelines. > > This patch avoids generating a switch with a single case statement, > instead preferring to use an "if (TREE_CODE (...) == SSA_NAME)" idiom. > These should compile to the same instructions, but the switch requires > more lines, especially when a debugger may set a break point on the > switch, the case, or the (obligatory) final "default:;". This reduces > the size of gimple-match.o by 53K on x86_64-pc-linux-gnu. > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > and make -k check with no new failures. Ok for mainline? Hmm, this makes the complicated code emission in gen_kids_1 even more complicated for a questionable gain which I'd rather not do, debuginfo savings or not ... Richard. > > 2022-03-16 Roger Sayle > > gcc/ChangeLog > * gcc/genmatch.cc (dt_node::gen_kids_1): Introduce use_switch > logic that prefers to generate an if statement rather than a > switch containing a single case (and a default). > > > Thanks in advance, > Roger > -- >