From: Jeff Law <jeffreyalaw@gmail.com>
To: Vineet Gupta <vineetg@rivosinc.com>,
Manolis Tsamis <manolis.tsamis@vrull.eu>
Cc: gcc-patches@gcc.gnu.org,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Richard Biener <richard.guenther@gmail.com>,
Jakub Jelinek <jakub@redhat.com>,
gnu-toolchain <gnu-toolchain@rivosinc.com>
Subject: Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.
Date: Thu, 20 Jul 2023 15:59:54 -0600 [thread overview]
Message-ID: <43afd736-4980-2d14-67a2-4425acf6d523@gmail.com> (raw)
In-Reply-To: <33394d74-60c6-dd0e-55a0-0e0901f05e2e@rivosinc.com>
On 7/20/23 00:18, Vineet Gupta wrote:
>
>
> On 7/18/23 21:31, Jeff Law via Gcc-patches wrote:
>>>
>>> In a run with -fno-fold-mem-offsets, the same insn 93 is successfully
>>> grok'ed by cprop_hardreg,
>>>
>>> | (insn 93 337 522 11 (set (mem/c:DF (plus:DI (reg/f:DI 2 sp)
>>> | (const_int 8 [0x8])) [4 %sfp+-8 S8 A64])
>>> | (const_double:DF 0.0 [0x0.0p+0])) "sff.i":23:11 190
>>> {*movdf_hardfloat_rv64}
>>> ^^^^^^^^^^^^^^^
>>> | (expr_list:REG_EQUAL (const_double:DF 0.0 [0x0.0p+0])
>>> | (nil)))
>>>
>>> P.S. I wonder if it is a good idea in general to call recog() post
>>> reload since the insn could be changed sufficiently to no longer
>>> match the md patterns. Of course I don't know the answer.
>> If this ever causes a problem, it's a backend bug. It's that simple.
>>
>> Conceptually it should always be safe to set INSN_CODE to -1 for any
>> insn.
>
> Sure the -1 should be handled, but are you implying that f-mo- will
> always generate a valid combination and recog() failing is simply a bug
> in backend and/or f-m-o. If not, the -1 setting can potentially trigger
> an ICE in future.
A recog failure after setting INSN_CODE to -1 would always be an
indicator of a target bug at the point where f-m-o runs.
In that would be generally true as well. There are some very obscure
exceptions and those exceptions are for narrow periods of time.
>
>>
>> Odds are for this specific case in the RV backend, we just need a
>> constraint to store 0.0 into a memory location. That can actually be
>> implemented as a store from x0 since 0.0 has the bit pattern 0x0. This
>> is probably a good thing to expose anyway as an optimization and can
>> move forward independently of the f-m-o patch.
>
> I call dibs on this :-) Seems like an interesting little side project.
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748
It's yours :-)
jeff
next prev parent reply other threads:[~2023-07-20 21:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 14:13 Manolis Tsamis
2023-07-13 15:05 ` Manolis Tsamis
2023-07-14 5:35 ` Jeff Law
2023-07-18 17:15 ` Manolis Tsamis
2023-07-18 18:01 ` Jeff Law
2023-07-18 23:42 ` Vineet Gupta
2023-07-19 4:31 ` Jeff Law
2023-07-19 8:08 ` Manolis Tsamis
2023-07-19 14:16 ` Jeff Law
2023-07-20 6:18 ` Vineet Gupta
2023-07-20 21:59 ` Jeff Law [this message]
2023-08-07 14:44 ` Manolis Tsamis
2023-08-07 17:13 ` Jeff Law
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=43afd736-4980-2d14-67a2-4425acf6d523@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gnu-toolchain@rivosinc.com \
--cc=jakub@redhat.com \
--cc=manolis.tsamis@vrull.eu \
--cc=philipp.tomsich@vrull.eu \
--cc=richard.guenther@gmail.com \
--cc=vineetg@rivosinc.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).