From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 7166B3858D33 for ; Thu, 28 Jul 2022 16:56:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7166B3858D33 Received: by mail-pf1-x436.google.com with SMTP id e16so2399172pfm.11 for ; Thu, 28 Jul 2022 09:56:01 -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=aJLbz+YDmAgbETnmANqt2cG6FOlEDPhekWFQ83IsLNs=; b=Uao6oW7VkWqPHVE5x3BMKKI+DsRMnW9bleu/e0c4tsOvQc93O27owAM8AunjjzGDsK 8kIt9P3rmU4l10HtGmA6+2JY30BHJcRMvN5OweecaViyDbgUft8vWFUpT4U6IHQk50I/ KiCRlYjm3Zq54Q8SWJ29o9zj8B2N0uMzL7WUgd+KZaXpBLTn0vLaubZrpio+fsTrELhT nHlObwpXzxlUzy9NjLG/3LWS+6TIUOc4B/hjPB8BwlczpRkzzaMWE6105S8hTWBC2tjq HagRiaFj7sj1U/UOu1XUlEaCmZEWxN7Gb2GQt/1O6FtPxs2n2omQEUtvQ1/IQn5+NURG nzYg== X-Gm-Message-State: AJIora+AJlU6Vz2GYjq6VtPVqP7jIuHCCNRSBv0hOWLwp99XGd14ysap 5MxykEK4tHpewFn2GO1MhaEerFLGoXV/s7FIMyHIRH0FEVw= X-Google-Smtp-Source: AGRyM1uAqYsqymPAJ62M9V2aKc7mApiQyoawXzxGoN1DZWP4V33+d1QLjKZCZVu+9ZuF1A5O2cEYd0YB6EvG/PuSejw= X-Received: by 2002:a05:6a00:14c5:b0:52b:8877:8263 with SMTP id w5-20020a056a0014c500b0052b88778263mr28130070pfu.1.1659027360260; Thu, 28 Jul 2022 09:56:00 -0700 (PDT) MIME-Version: 1.0 References: <008b01d8a2a1$2ab6ff60$8024fe20$@nextmovesoftware.com> In-Reply-To: <008b01d8a2a1$2ab6ff60$8024fe20$@nextmovesoftware.com> From: "H.J. Lu" Date: Thu, 28 Jul 2022 09:55:24 -0700 Message-ID: Subject: Re: [x86_64 PATCH] PR target/106450: Tweak timode_remove_non_convertible_regs. To: Roger Sayle Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3018.5 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: Thu, 28 Jul 2022 16:56:03 -0000 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.