From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by sourceware.org (Postfix) with ESMTPS id 7D2053858D1E for ; Sat, 14 Jan 2023 18:05:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D2053858D1E 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-yw1-x112f.google.com with SMTP id 00721157ae682-4bf16baa865so326975767b3.13 for ; Sat, 14 Jan 2023 10:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=w4czE00O/Kt+widrffTaIiKEGyK+g7Iuf/bo6bN9NY8=; b=TT5wgu7caglc5wFKa5mzK3GTVerOFK/Xg30XBcKIc/WckOfkRvWDeVGOLg+/rsCvHP v2DEpbuKiEnVLd1pfjQlcvK0llnArRcrfr0cYznAXdu5aXcau38tHvnY5YoA2emLqo0m NjhSBewmWa85dzJKmtdsy8TDOtDcfFvoJf5V6UWwLOSv05HimlUn3/X9po3kSK3aBZha lUVJWs7ZAAYCe6o/IhW1aqUea7r1uVFYObbnUqXlchMQIhsi3h9q3XFeAsf4+fMzddtJ Y8E/egX9lDEEt+pTtWxb1pHAqKP9GIR7LHcGQC4X+YBZMBAMN98y/2vqVo1t+5kT8KZR /EUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w4czE00O/Kt+widrffTaIiKEGyK+g7Iuf/bo6bN9NY8=; b=LJ8eoj4WLVH3s19HbbzZG9Yq5LEhft/sb/g4yQVMApbHZVKNDy4RfU1MUjwgkDgFRE KcmyNGS3lAUsUhMstEOoEngNnHG8LPZpgttgOHoVsE+AVTb5ibvcVy6k3k40wLo8bckH PaLl3UY+fp9NcaE8NyZwCOv9p+pmSwZJ+xzK66A/OPZ4YRO+WDt8D0Uzx5tcSwmJINXE Iqn18EnQqaTmFjE20fNmfQMsOulVRxeeedzz+ORbKOiG+1vxuFaYEDJh3NELgGLEQ/Yd m6sombhhG5jC0BErqp989sz/8iklLtQuJSsSKbkXUYx2fSa4SesSZm53Nqe9nwhmSs4w rz+Q== X-Gm-Message-State: AFqh2kri4KDOopCLg88jL1lC3V5Ewt7S1l4UJ37E94p4pDof4Vddfwzm WvD7nLqgPyHSu8OLgtDGBByYWlA50ZaGI120E6o= X-Google-Smtp-Source: AMrXdXv6Kt25cvaHamy6KgUHgYeGZjlMksNKX017ciCRkGfipDU6gwhgAhvTKhDVLhRIxK8SGAMt8qXs6tnFF5QfHjw= X-Received: by 2002:a0d:eac9:0:b0:4d9:232:22d6 with SMTP id t192-20020a0deac9000000b004d9023222d6mr1550799ywe.247.1673719509869; Sat, 14 Jan 2023 10:05:09 -0800 (PST) MIME-Version: 1.0 References: <0707a800-d409-2264-d2a5-21f43ebeaf6f.ref@yahoo.co.jp> <0707a800-d409-2264-d2a5-21f43ebeaf6f@yahoo.co.jp> In-Reply-To: <0707a800-d409-2264-d2a5-21f43ebeaf6f@yahoo.co.jp> From: Max Filippov Date: Sat, 14 Jan 2023 10:04:58 -0800 Message-ID: Subject: Re: [PATCH] xtensa: Remove old broken tweak for leaf function To: "Takayuki 'January June' Suwa" Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Fri, Jan 13, 2023 at 9:03 PM Takayuki 'January June' Suwa wrote: > > In the before-IRA era, ORDER_REGS_FOR_LOCAL_ALLOC was called for each > function in Xtensa, and there was register allocation table reordering > for leaf functions to compensate for the poor performance of local-alloc. > > Today the adjustment hook is still called via its alternative > ADJUST_REG_ALLOC_ORDER, but it is only called once at the start of the IRA, > and leaf_function_p() erroneously returns true and also gives no argument > count. > > That straightforwardly misleads register allocation that all functions are > always leaves with no arguments, which leads to inefficiencies in allocation > results. > > Fortunately, IRA is smart enough than local-alloc to not need such assistance. > > This patch does away with the antiquated by removing the wreckage that no > longer works. > > gcc/ChangeLog: > > * config/xtensa/xtensa-protos.h (order_regs_for_local_alloc): > Rename to xtensa_adjust_reg_alloc_order. > * config/xtensa/xtensa.cc (xtensa_adjust_reg_alloc_order): > Ditto. And also remove code to reorder register numbers for > leaf functions, rename the tables, and adjust the allocation > order for the call0 ABI to use register A0 more. > (xtensa_leaf_regs): Remove. > * config/xtensa/xtensa.h (REG_ALLOC_ORDER): Cosmetics. > (order_regs_for_local_alloc): Rename as the above. > (LEAF_REGISTERS, LEAF_REG_REMAP, leaf_function): Remove. > --- > gcc/config/xtensa/xtensa-protos.h | 2 +- > gcc/config/xtensa/xtensa.cc | 77 +++++++------------------------ > gcc/config/xtensa/xtensa.h | 51 ++++++-------------- > 3 files changed, 31 insertions(+), 99 deletions(-) Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max