[gcc r14-2894] Adjust testcase for more optimal codegen.

hongtao Liu liuhongt@gcc.gnu.org
Tue Aug 1 06:01:01 GMT 2023


https://gcc.gnu.org/g:01b0c36ba0c3bbe6ce0b0c77297e16d9531aac69

commit r14-2894-g01b0c36ba0c3bbe6ce0b0c77297e16d9531aac69
Author: liuhongt <hongtao.liu@intel.com>
Date:   Tue Aug 1 12:48:21 2023 +0800

    Adjust testcase for more optimal codegen.
    
    After
    b9d7140c80bd3c7355b8291bb46f0895dcd8c3cb is the first bad commit
    commit b9d7140c80bd3c7355b8291bb46f0895dcd8c3cb
    Author: Jan Hubicka <jh@suse.cz>
    Date:   Fri Jul 28 09:16:09 2023 +0200
    
        loop-split improvements, part 1
    
    Now we have
        vpbroadcastd %ecx, %xmm0
        vpaddd .LC3(%rip), %xmm0, %xmm0
        vpextrd $3, %xmm0, %eax
        vmovddup %xmm3, %xmm0
        vrndscalepd $9, %xmm0, %xmm0
        vunpckhpd %xmm0, %xmm0, %xmm3
    
    for vrndscalepd, no need to insert pxor since it reuses input register
    xmm0 to avoid partial sse dependece.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr87007-4.c: Adjust testcase.
            * gcc.target/i386/pr87007-5.c: Ditto.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr87007-4.c | 6 +++---
 gcc/testsuite/gcc.target/i386/pr87007-5.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/pr87007-4.c b/gcc/testsuite/gcc.target/i386/pr87007-4.c
index e91bdcbac44..23b5c5dcc52 100644
--- a/gcc/testsuite/gcc.target/i386/pr87007-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr87007-4.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse" } */
-
+/* { dg-options "-O2 -march=skylake-avx512 -mfpmath=sse" } */
+/* Load of d2/d3 is hoisted out, vrndscalesd will reuse loades register to avoid partial dependence.  */
 
 #include<math.h>
 
@@ -15,4 +15,4 @@ foo (int n, int k)
       d1 = ceil (d3);
 }
 
-/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
+/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 0 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr87007-5.c b/gcc/testsuite/gcc.target/i386/pr87007-5.c
index 20d13cf650b..b36e81c270c 100644
--- a/gcc/testsuite/gcc.target/i386/pr87007-5.c
+++ b/gcc/testsuite/gcc.target/i386/pr87007-5.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse" } */
-
+/* { dg-options "-Ofast -march=skylake-avx512 -mfpmath=sse -fno-tree-vectorize" } */
+/* Load of d2/d3 is hoisted out, vrndscalesd will reuse loades register to avoid partial dependence.  */
 
 #include<math.h>
 
@@ -15,4 +15,4 @@ foo (int n, int k)
       d1 = sqrt (d3);
 }
 
-/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
+/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 0 } } */


More information about the Gcc-cvs mailing list