From: Richard Biener <richard.guenther@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [middle-end PATCH] Constant fold {-1,-1} << 1 in simplify-rtx.cc
Date: Tue, 7 May 2024 11:54:39 +0200 [thread overview]
Message-ID: <CAFiYyc2RU3hpp0XgEh_GQ-v_yacRtU5y7-9LzLEkk-e8E3i0yA@mail.gmail.com> (raw)
In-Reply-To: <007f01da5085$08c48420$1a4d8c60$@nextmovesoftware.com>
On Fri, Jan 26, 2024 at 7:26 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This patch addresses a missed optimization opportunity in the RTL
> optimization passes. The function simplify_const_binary_operation
> will constant fold binary operators with two CONST_INT operands,
> and those with two CONST_VECTOR operands, but is missing compile-time
> evaluation of binary operators with a CONST_VECTOR and a CONST_INT,
> such as vector shifts and rotates.
>
> My first version of this patch didn't contain a switch statement to
> explicitly check for valid binary opcodes, which bootstrapped and
> regression tested fine, but by paranoia has got the better of me,
> so this version now checks that VEC_SELECT or some funky (future)
> rtx_code doesn't cause problems.
>
> 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 (in stage 1)?
OK.
Thanks,
Richard.
>
> 2024-01-26 Roger Sayle <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
> * simplify-rtx.cc (simplify_const_binary_operation): Constant
> fold binary operations where the LHS is CONST_VECTOR and the
> RHS is CONST_INT (or CONST_DOUBLE) such as vector shifts.
>
>
> Thanks in advance,
> Roger
> --
>
prev parent reply other threads:[~2024-05-07 9:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 18:25 Roger Sayle
2024-05-07 9:54 ` Richard Biener [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFiYyc2RU3hpp0XgEh_GQ-v_yacRtU5y7-9LzLEkk-e8E3i0yA@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=roger@nextmovesoftware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).