arm: testsuite: Adapt mve-vabs.c to improved codegen
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
Since commit r15-491-gc290e6a0b7a9de this failure happens on on
armv8l-linux-gnueabihf and arm-eabi:
Running gcc:gcc.target/arm/simd/simd.exp ...
gcc.target/arm/simd/mve-vabs.c: memmove found 0 times
FAIL: gcc.target/arm/simd/mve-vabs.c scan-assembler-times memmove 3
In PR PR target/116010, Andrew Pinski noted that
"gcc.target/arm/simd/mve-vabs.c now calls memcpy because of the restrict
instead of memmove. That should be a simple fix there."
Therefore change the test to expect memcpy rather than memmove.
Another change is that memcpy is inlined rather than called, so also change
the test to check the optimized tree dump rather than the generated
assembly.
Tested on armv8l-linux-gnueabihf and arm-eabi.
gcc/testsuite/ChangeLog:
PR target/116010
* gcc.target/arm/simd/mve-vabs.c: Test tree dump and adjust to new
code.
Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
---
gcc/testsuite/gcc.target/arm/simd/mve-vabs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Sun, 2 Feb 2025 at 21:18, Thiago Jung Bauermann
<thiago.bauermann@linaro.org> wrote:
>
> Since commit r15-491-gc290e6a0b7a9de this failure happens on on
> armv8l-linux-gnueabihf and arm-eabi:
>
> Running gcc:gcc.target/arm/simd/simd.exp ...
> gcc.target/arm/simd/mve-vabs.c: memmove found 0 times
> FAIL: gcc.target/arm/simd/mve-vabs.c scan-assembler-times memmove 3
>
> In PR PR target/116010, Andrew Pinski noted that
> "gcc.target/arm/simd/mve-vabs.c now calls memcpy because of the restrict
> instead of memmove. That should be a simple fix there."
>
> Therefore change the test to expect memcpy rather than memmove.
>
> Another change is that memcpy is inlined rather than called, so also change
> the test to check the optimized tree dump rather than the generated
> assembly.
>
> Tested on armv8l-linux-gnueabihf and arm-eabi.
>
LGTM, thanks.
Christophe
> gcc/testsuite/ChangeLog:
> PR target/116010
> * gcc.target/arm/simd/mve-vabs.c: Test tree dump and adjust to new
> code.
>
> Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
> gcc/testsuite/gcc.target/arm/simd/mve-vabs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vabs.c b/gcc/testsuite/gcc.target/arm/simd/mve-vabs.c
> index f2f9ee349906..e85d0b18ee71 100644
> --- a/gcc/testsuite/gcc.target/arm/simd/mve-vabs.c
> +++ b/gcc/testsuite/gcc.target/arm/simd/mve-vabs.c
> @@ -1,7 +1,7 @@
> /* { dg-do assemble } */
> /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
> /* { dg-add-options arm_v8_1m_mve_fp } */
> -/* { dg-additional-options "-O3 -funsafe-math-optimizations" } */
> +/* { dg-additional-options "-O3 -funsafe-math-optimizations -fdump-tree-optimized" } */
>
> #include <stdint.h>
> #include <arm_mve.h>
> @@ -35,10 +35,10 @@ FUNC_FLOAT(f, float, 32, 4, vabs)
> FUNC(f, float, 16, 8, vabs)
>
> /* Taking the absolute value of an unsigned value is a no-op, so half of the
> - integer optimizations actually generate a call to memmove, the other ones a
> + integer optimizations actually generate a call to memcpy, the other ones a
> 'vabs'. */
> /* { dg-final { scan-assembler-times {vabs.s[0-9]+\tq[0-9]+, q[0-9]+} 3 } } */
> /* { dg-final { scan-assembler-times {vabs.f[0-9]+\tq[0-9]+, q[0-9]+} 2 } } */
> /* { dg-final { scan-assembler-times {vldr[bhw].[0-9]+\tq[0-9]+} 5 } } */
> /* { dg-final { scan-assembler-times {vstr[bhw].[0-9]+\tq[0-9]+} 5 } } */
> -/* { dg-final { scan-assembler-times {memmove} 3 } } */
> +/* { dg-final { scan-tree-dump-times "memcpy" 3 "optimized" } } */
Christophe Lyon <christophe.lyon@linaro.org> writes:
> On Sun, 2 Feb 2025 at 21:18, Thiago Jung Bauermann
> <thiago.bauermann@linaro.org> wrote:
>>
>> Since commit r15-491-gc290e6a0b7a9de this failure happens on on
>> armv8l-linux-gnueabihf and arm-eabi:
>>
>> Running gcc:gcc.target/arm/simd/simd.exp ...
>> gcc.target/arm/simd/mve-vabs.c: memmove found 0 times
>> FAIL: gcc.target/arm/simd/mve-vabs.c scan-assembler-times memmove 3
>>
>> In PR PR target/116010, Andrew Pinski noted that
>> "gcc.target/arm/simd/mve-vabs.c now calls memcpy because of the restrict
>> instead of memmove. That should be a simple fix there."
>>
>> Therefore change the test to expect memcpy rather than memmove.
>>
>> Another change is that memcpy is inlined rather than called, so also change
>> the test to check the optimized tree dump rather than the generated
>> assembly.
>>
>> Tested on armv8l-linux-gnueabihf and arm-eabi.
>
> LGTM, thanks.
Thanks! Pushed as commit bcd3886e6692 ("arm: testsuite: Adapt mve-vabs.c
to improved codegen").
--
Thiago
@@ -1,7 +1,7 @@
/* { dg-do assemble } */
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
/* { dg-add-options arm_v8_1m_mve_fp } */
-/* { dg-additional-options "-O3 -funsafe-math-optimizations" } */
+/* { dg-additional-options "-O3 -funsafe-math-optimizations -fdump-tree-optimized" } */
#include <stdint.h>
#include <arm_mve.h>
@@ -35,10 +35,10 @@ FUNC_FLOAT(f, float, 32, 4, vabs)
FUNC(f, float, 16, 8, vabs)
/* Taking the absolute value of an unsigned value is a no-op, so half of the
- integer optimizations actually generate a call to memmove, the other ones a
+ integer optimizations actually generate a call to memcpy, the other ones a
'vabs'. */
/* { dg-final { scan-assembler-times {vabs.s[0-9]+\tq[0-9]+, q[0-9]+} 3 } } */
/* { dg-final { scan-assembler-times {vabs.f[0-9]+\tq[0-9]+, q[0-9]+} 2 } } */
/* { dg-final { scan-assembler-times {vldr[bhw].[0-9]+\tq[0-9]+} 5 } } */
/* { dg-final { scan-assembler-times {vstr[bhw].[0-9]+\tq[0-9]+} 5 } } */
-/* { dg-final { scan-assembler-times {memmove} 3 } } */
+/* { dg-final { scan-tree-dump-times "memcpy" 3 "optimized" } } */