From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by sourceware.org (Postfix) with ESMTPS id AEBBC3858017 for ; Sun, 31 Jul 2022 17:23:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEBBC3858017 Received: by mail-qt1-x82a.google.com with SMTP id h22so6528704qta.3 for ; Sun, 31 Jul 2022 10:23:36 -0700 (PDT) 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; bh=PTvsCJBUREyg06WiM3TZJwfSfZN1Xn8e8pkbtP1sqPY=; b=DBjMQRLWZMm5Ja9uRRUCW0qwwVxNCZim+weWxSSVELH2Q2oRJZwUabj+ObceRgI0oj FnZE+DWpFQnY76KJyqNADXY2bkvqSabdCt3lznV8wlfM9GCzdjA75owaQGhZg1I5ZXB/ nLCko9TVWXTjj4Omm93avu3VV2M1AwmsK84bP18shQgcXJ52swcowcP5IzxszRTONEEY bcAvsd75qDbnWJxDc3ZfYxx/aVsqE32MEY8ZXbDH488edkcEgLkUbh8N3QC5rSP6xdwE CgjC08P+F27Ofp0mMJC+ffCli5OY0X7mFGNZvilp9a+JDJbIJaGga3FtKihIBFsiEUnA 6oMw== X-Gm-Message-State: AJIora90yW7CkermzDGbuYg6RwY1HIOz7sY/6Rzf5aEaRQ4S6foUYhQZ lBOl6UQKU9dfqwsZyNPrYxoHcxXORCkSJAhDnUT9F9TTB1MqCQ== X-Google-Smtp-Source: AGRyM1vtArbaxtFjfPFGwbK5XE9SeQyZpKXPV5JJUli9jCu6aPVzjfIzxavmu2HpWDih8WdKz/xEtFIuR8ZhTZ824G0= X-Received: by 2002:ac8:5905:0:b0:31e:e346:e080 with SMTP id 5-20020ac85905000000b0031ee346e080mr11070059qty.569.1659288216029; Sun, 31 Jul 2022 10:23:36 -0700 (PDT) MIME-Version: 1.0 References: <008b01d8a2a1$2ab6ff60$8024fe20$@nextmovesoftware.com> <040c01d8a3f8$a6056d20$f2104760$@nextmovesoftware.com> In-Reply-To: <040c01d8a3f8$a6056d20$f2104760$@nextmovesoftware.com> From: Uros Bizjak Date: Sun, 31 Jul 2022 19:23:24 +0200 Message-ID: Subject: Re: [x86_64 PATCH take #2] PR target/106450: Tweak timode_remove_non_convertible_regs. To: Roger Sayle Cc: GCC Patches , "H.J. Lu" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, 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 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: Sun, 31 Jul 2022 17:23:38 -0000 On Sat, Jul 30, 2022 at 11:42 AM Roger Sayle wrote: > > > Many thanks to H.J. for pointing out a better idiom for traversing > the USEs (and also DEFs) of TImode registers in an instruction. > > This revised patched has been tested on x86_64-pc-linux-gnu with > make bootstrap and make -k check, both with and without > --target_board=unix{-m32}, with no new failures. Ok for mainline? > > > 2022-07-30 Roger Sayle > H.J. Lu > > gcc/ChangeLog > PR target/106450 > * config/i386/i386-features.cc (timode_check_non_convertible_regs): > Do nothing if REGNO is set in the REGS bitmap, or is a hard reg. > (timode_remove_non_convertible_regs): Update comment. > Call timode_check_non_convertible_reg on all TImode register > DEFs and USEs in each instruction. > > gcc/testsuite/ChangeLog > PR target/106450 > * gcc.target/i386/pr106450.c: New test case. LGTM. Thanks, Uros. > > > Thanks (H.J. and Uros), > Roger > -- > > > -----Original Message----- > > From: H.J. Lu > > Sent: 28 July 2022 17:55 > > To: Roger Sayle > > Cc: GCC Patches > > Subject: Re: [x86_64 PATCH] PR target/106450: Tweak > > timode_remove_non_convertible_regs. > > > > On Thu, Jul 28, 2022 at 9:43 AM Roger Sayle > > wrote: > > > > > > This patch resolves PR target/106450, some more fall-out from more > > > aggressive TImode scalar-to-vector (STV) optimizations. I continue to > > > be caught out by how far TImode STV has diverged from DImode/SImode > > > STV, and therefore requires additional (unexpected) tweaking. Many > > > thanks to H.J. Lu for pointing out timode_remove_non_convertible_regs > > > needs to be extended to handle XOR (and other new operations). > > > > > > Unhelpfully the comment above this function states that it's the > > > TImode version of "remove_non_convertible_regs", which doesn't exist > > > anymore, so I've resurrected an explanatory comment from the git history. > > > By refactoring the checks for hard regs and already "marked" regs into > > > timode_check_non_convertible_regs itself, all its callers are > > > simplified. This patch then uses GET_RTX_CLASS to generically handle > > > unary and binary operations, calling timode_check_non_convertible_regs > > > on each TImode register operand in the single_set's SET_SRC. > > > > > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > > > and make -k check, both with and without --target_board=unix{-m32}, > > > with no new failures. Ok for mainline? > > > > > > > > > 2022-07-28 Roger Sayle > > > > > > gcc/ChangeLog > > > PR target/106450 > > > * config/i386/i386-features.cc (timode_check_non_convertible_regs): > > > Do nothing if REGNO is set in the REGS bitmap, or is a hard reg. > > > (timode_remove_non_convertible_regs): Update comment. > > > Call timode_check_non_convertible_regs on all register operands > > > of supported (binary and unary) operations. > > > > Should we use > > > > df_ref ref; > > FOR_EACH_INSN_USE (ref, insn) > > if (!DF_REF_REG_MEM_P (ref)) > > timode_check_non_convertible_regs (candidates, regs, > > DF_REF_REGNO (ref)); > > > > to check each use? > > > > > gcc/testsuite/ChangeLog > > > PR target/106450 > > > * gcc.target/i386/pr106450.c: New test case. > > > > > > > > > Thanks in advance, > > > Roger > > > -- > > -- > > H.J.