testsuite/rs6000: Add option to ignore vect cost model

Message ID cff24f6b-1228-3d90-c942-1bd9fcb7570a@linux.ibm.com
State New
Headers show
Series
  • testsuite/rs6000: Add option to ignore vect cost model
Related show

Commit Message

Ian Lance Taylor via Gcc-patches July 16, 2020, 6:51 a.m.
Hi,

In my testing with cost tweaking for vector with length, I found
two cases below didn't get the expected output.  Since the expected
instructions reply on the vectorization occurrence, we don't expect
vectorization gets disabled by cost model.

To make it not fragile, the fix is to force it without vect cost model.

Is it ok for trunk?

BR,
Kewen
---
gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/conv-vectorize-1.c: Add option
	-fno-vect-cost-model.
	* gcc.target/powerpc/conv-vectorize-2.c: Likewise.

------

Comments

Segher Boessenkool July 16, 2020, 8:31 p.m. | #1
Hi!

On Thu, Jul 16, 2020 at 02:51:23PM +0800, Kewen.Lin wrote:
> In my testing with cost tweaking for vector with length, I found

> two cases below didn't get the expected output.  Since the expected

> instructions reply on the vectorization occurrence, we don't expect

> vectorization gets disabled by cost model.

> 

> To make it not fragile, the fix is to force it without vect cost model.


From the subject it wasn't clear to me that you just add the flag (not
implement a new option :-) ), and only to two testcases.  Maybe
  rs6000/test: Add -fno-vect-cost-model to conv-vectorize-[12].c
or even
  rs6000/test: Add -fno-vect-cost-model to some tests


Okay for trunk.  Thanks!


Segher
Ian Lance Taylor via Gcc-patches July 17, 2020, 2:25 a.m. | #2
Hi,

on 2020/7/17 上午4:31, Segher Boessenkool wrote:
> Hi!

> 

> On Thu, Jul 16, 2020 at 02:51:23PM +0800, Kewen.Lin wrote:

>> In my testing with cost tweaking for vector with length, I found

>> two cases below didn't get the expected output.  Since the expected

>> instructions reply on the vectorization occurrence, we don't expect

>> vectorization gets disabled by cost model.

>>

>> To make it not fragile, the fix is to force it without vect cost model.

> 

> From the subject it wasn't clear to me that you just add the flag (not

> implement a new option :-) ), and only to two testcases.  Maybe

>   rs6000/test: Add -fno-vect-cost-model to conv-vectorize-[12].c


Oh my poor naming skills ;-)  Will fix it with this.

> or even

>   rs6000/test: Add -fno-vect-cost-model to some tests

> 

> 

> Okay for trunk.  Thanks!


Thanks!
Kewen

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c
index d96db146864..8b8c88befd5 100644
--- a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -ftree-vectorize -mvsx" } */
+/* { dg-options "-O2 -ftree-vectorize -mvsx -fno-vect-cost-model" } */

 /* Test vectorizer can exploit vector conversion instructions to convert
    unsigned/signed long long to float.  */
diff --git a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c
index 5dd5deabdd3..06ae4e2d5ce 100644
--- a/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/conv-vectorize-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -ftree-vectorize -mvsx" } */
+/* { dg-options "-O2 -ftree-vectorize -mvsx -fno-vect-cost-model" } */

 /* Test vectorizer can exploit vector conversion instructions to convert
    float to unsigned/signed long long.  */