RISC-V: xfail gcc.dg/pr90263.c for riscv_v

Message ID 20231004215742.929536-1-patrick@rivosinc.com
State Accepted
Headers
Series RISC-V: xfail gcc.dg/pr90263.c for riscv_v |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Patrick O'Neill Oct. 4, 2023, 9:57 p.m. UTC
  Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
perform a memcpy. We no longer expect memcpy for riscv_v targets.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr90263.c: xfail riscv_v targets.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
Co-authored-by: Joern Rennecke <joern.rennecke@embecosm.com>
---
 gcc/testsuite/gcc.dg/pr90263.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.34.1
  

Comments

Jeff Law Oct. 4, 2023, 10:14 p.m. UTC | #1
On 10/4/23 15:57, Patrick O'Neill wrote:
> Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
> perform a memcpy. We no longer expect memcpy for riscv_v targets.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/pr90263.c: xfail riscv_v targets.
Or rather than XFAIL skip the test?  XFAIL kind of implies its something 
we'd like to fix.  But in this case we don't want a memcpy call as the 
inlined vector implementation is almost certainly better.

You might be able to use riscv_v in a dg-skip-if directive.  Not sure.


Jeff
  
Patrick O'Neill Oct. 4, 2023, 10:21 p.m. UTC | #2
On 10/4/23 15:14, Jeff Law wrote:
>
>
> On 10/4/23 15:57, Patrick O'Neill wrote:
>> Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
>> perform a memcpy. We no longer expect memcpy for riscv_v targets.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * gcc.dg/pr90263.c: xfail riscv_v targets.
> Or rather than XFAIL skip the test?  XFAIL kind of implies its 
> something we'd like to fix.  But in this case we don't want a memcpy 
> call as the inlined vector implementation is almost certainly better.
Ah. Since XFAIL notifies us if a test starts passing (via xpass) I
thought it would help us ensure the test doesn't start passing
on riscv_v. I didn't know it implied something needed to be fixed.

I'll rework it to skip riscv_v targets.

Thanks,
Patrick

> You might be able to use riscv_v in a dg-skip-if directive.  Not sure.
>
>
> Jeff
  
Jeff Law Oct. 4, 2023, 10:29 p.m. UTC | #3
On 10/4/23 16:21, Patrick O'Neill wrote:
> 
> On 10/4/23 15:14, Jeff Law wrote:
>>
>>
>> On 10/4/23 15:57, Patrick O'Neill wrote:
>>> Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
>>> perform a memcpy. We no longer expect memcpy for riscv_v targets.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>>     * gcc.dg/pr90263.c: xfail riscv_v targets.
>> Or rather than XFAIL skip the test?  XFAIL kind of implies its 
>> something we'd like to fix.  But in this case we don't want a memcpy 
>> call as the inlined vector implementation is almost certainly better.
> Ah. Since XFAIL notifies us if a test starts passing (via xpass) I
> thought it would help us ensure the test doesn't start passing
> on riscv_v. I didn't know it implied something needed to be fixed.
> 
> I'll rework it to skip riscv_v targets.
Hopefully that works.

If you wanted a test to verify that we don't go backwards and start 
emitting a memcpy, you can set up a test like

// dg-directives
#include "pr90263.c"

// dg directives for scanning

Where the scanning verifies that we don't have a call to memcpy.  The 
kind of neat thing here is the dg directives in the included file are 
ignored, so you can use the same test sources in multiple ways.

Given this is kindof specific to risc-v, it might make more sense in the 
riscv directory.

Jeff
  
Patrick O'Neill Oct. 5, 2023, 4:42 p.m. UTC | #4
On 10/4/23 15:29, Jeff Law wrote:
>
>
> On 10/4/23 16:21, Patrick O'Neill wrote:
>>
>> On 10/4/23 15:14, Jeff Law wrote:
>>>
>>>
>>> On 10/4/23 15:57, Patrick O'Neill wrote:
>>>> Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
>>>> perform a memcpy. We no longer expect memcpy for riscv_v targets.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>>     * gcc.dg/pr90263.c: xfail riscv_v targets.
>>> Or rather than XFAIL skip the test?  XFAIL kind of implies its 
>>> something we'd like to fix.  But in this case we don't want a memcpy 
>>> call as the inlined vector implementation is almost certainly better.
>> Ah. Since XFAIL notifies us if a test starts passing (via xpass) I
>> thought it would help us ensure the test doesn't start passing
>> on riscv_v. I didn't know it implied something needed to be fixed.
>>
>> I'll rework it to skip riscv_v targets.
> Hopefully that works.
>
> If you wanted a test to verify that we don't go backwards and start 
> emitting a memcpy, you can set up a test like
>
> // dg-directives
> #include "pr90263.c"
>
> // dg directives for scanning
>
> Where the scanning verifies that we don't have a call to memcpy. The 
> kind of neat thing here is the dg directives in the included file are 
> ignored, so you can use the same test sources in multiple ways.
>
> Given this is kindof specific to risc-v, it might make more sense in 
> the riscv directory.
>
> Jeff

Title changed/superseded by:
https://inbox.sourceware.org/gcc-patches/20231004225527.930610-1-patrick@rivosinc.com/T/#u

Patrick
  

Patch

diff --git a/gcc/testsuite/gcc.dg/pr90263.c b/gcc/testsuite/gcc.dg/pr90263.c
index 3222a5331c1..13f4a85fa0f 100644
--- a/gcc/testsuite/gcc.dg/pr90263.c
+++ b/gcc/testsuite/gcc.dg/pr90263.c
@@ -9,4 +9,4 @@  int *f (int *p, int *q, long n)
 }

 /* { dg-final { scan-assembler "mempcpy" { target { i?86-*-* x86_64-*-* } } } } */
-/* { dg-final { scan-assembler "memcpy" { target { ! { i?86-*-* x86_64-*-* } } } } } */
+/* { dg-final { scan-assembler "memcpy" { target { ! { i?86-*-* x86_64-*-* } } xfail { riscv_v } } } } */