Kyrylo Tkachov <ktkac...@nvidia.com> writes:
>> On 9 Sep 2024, at 11:06, Tamar Christina <tamar.christ...@arm.com> wrote:
>> 
>> External email: Use caution opening links or attachments
>> 
>> 
>>> -----Original Message-----
>>> From: Richard Sandiford <richard.sandif...@arm.com>
>>> Sent: Monday, September 9, 2024 9:29 AM
>>> To: Tamar Christina <tamar.christ...@arm.com>
>>> Cc: gcc-patches@gcc.gnu.org; nd <n...@arm.com>; Richard Earnshaw
>>> <richard.earns...@arm.com>; Marcus Shawcroft
>>> <marcus.shawcr...@arm.com>; ktkac...@gcc.gnu.org
>>> Subject: Re: [PATCH 4/4]AArch64: Define VECTOR_STORE_FLAG_VALUE.
>>> 
>>> Tamar Christina <tamar.christ...@arm.com> writes:
>>>> Hi All,
>>>> 
>>>> This defines VECTOR_STORE_FLAG_VALUE to CONST1_RTX for AArch64
>>>> so we simplify vector comparisons in AArch64.
>>>> 
>>>> With this enabled
>>>> 
>>>> res:
>>>>        movi    v0.4s, 0
>>>>        cmeq    v0.4s, v0.4s, v0.4s
>>>>        ret
>>>> 
>>>> is simplified to:
>>>> 
>>>> res:
>>>>        mvni    v0.4s, 0
>>>>        ret
>>>> 
>>>> NOTE: I don't really like the testcase as it depends on an
>>>> uninitialised value to hide the constant from GIMPLE.
>>>> 
>>>> Happy to go with something else if there are any suggestions.
>>>> I thought about an RTL testcase, but those seem painful.
>>> 
>>> Like you say, I think an RTL testcase would be better.  Could you use
>>> the attached (for gcc.dg/rtl/aarch64)?
>>> 
>> 
>> Thanks, do you have any tips for writing these? If there a way to dump a
>> skeleton like with the gimple tests?

TBH I just take one I wrote earlier that looks relatively close,
then adapt it.  They're not something I could easily write from scratch.

> As a tangent, I wonder if the RTL dump logic can be extended to have a 
> dump-for-rtl-testcase mode, under the reasoning that creating RTL test cases 
> for ICE fixes is a common action. It could even be used in the EMERGENCY DUMP 
> case when dumping during an ICE.

Yeah, perhaps.  But I think there is an advantage in writing the test
by hand, to make sure that everything in the test is necessary and
relatively future-proof.

Often, the reason for using an RTL testcase is that it isn't easy
to create a minimal RTL reproducer from gimple.  Most EMERGENCY DUMPs
from non-RTL testcases are therefore likely to contain stuff that isn't
directly relevant.

Thanks,
Richard

Reply via email to