https://gcc.gnu.org/g:8d7b0bb05075c6f33bb6e5e9bd1b61ec65f19130

commit 8d7b0bb05075c6f33bb6e5e9bd1b61ec65f19130
Author: Alexandre Oliva <[email protected]>
Date:   Sat Jan 31 01:52:22 2026 -0300

    testsuite: riscv: adjust/xfail dynamic-lmul tests
    
    While investigating riscv*-elf testsuite failures in gcc-15, I found
    mainline still had failures for a number of the dynamic-lmul tests I
    investigated, though not always the same as gcc-15 due to other
    changes.  Here are some adjustments to the tests, whether updates or
    xfails, to fix or silence the failures for gcc-16, respectively.
    
    * dynamic-lmul4-3.c: r16-843 had bumped the "Maximum lmul = 2" count,
    which was reasonable then, but subsequent changes in e.g. r16-2515
    restored the original count, so revert that expectation.
    
    * dynamic-lmul4-7.c: SLP improvements seem to have caused us to find
    more live V_REGs during analysis, so we choose 1 instead of 2 for
    lmul.  Because of additional live V_REGs, AFAICT introduced by SLP, we
    lower the RVV mode choice twice rather than the expected once.  Since
    the SLP improvements AFAICT make the code worse, at least for leading
    to a lower lmul choice, I'm marking these two deviations as expected
    failures.
    
    * dynamic-lmul4-5.c: Like 4-7, this one regressed in the lmul choice
    due to extra live V_REGs, and thus got extra messages about preferring
    a lower lmul.  As for the start/end patterns, I can't tell what they
    were meant to test, but the live V_REGs have changed so significantly,
    and are so likely to keep changing, that I figured we're better off
    dropping those failing expectations.  This is the only test that had
    them.
    
    * dynamic-lmul4-6.c: For some reason I haven't tried to figure out,
    but I guess it also has to do with SLP improvements, the "Maximum lmul
    = [24]" messages are no longer printed after "Update local program
    points for bb 6" for this test, so I'm XFAILing them, because that
    feels like a regression even though we end up with the expected lmul.
    
    * dynamic-lmul4-8.c: Same as 4-6.
    
    * dynamic-lmul8-10.c: I haven't tried to figure out why the initial
    maximum lmul estimate has fallen from 8 to 4, despite the V_REG's
    count being (proportionally) the same and fitting, but we still choose
    8 for lmul, so I'm dropping the requirement for an 'lmul = 8' match
    under the tentative conclusion that the expectation is unnecessary.
    
    * dynamic-lmul8-12.c: Same as 8-10 and 4-6.
    
    * pr113112-3.c: We get a much higher lmul (m8) than expected (m2), for
    the same e32 element size, but the generated code is far too much
    larger and hairier.  While the lmul bump is probably a welcome
    improvement, the expected choice of return instruction isn't found,
    and I can't tell why the test prefers one over the other, so I'm
    XFAILing all of them.
    
    * pr113112-4.c: We get a lower lmul than expected, but that
    expectation was different before r15-639, and we get what we used to
    expect before that change.  Since we could do better at some point,
    I'm XFAILing it.
    
    
    for  gcc/testsuite/ChangeLog
    
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c: Revert
            Maximum lmul = 2 count.
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c: XFAIL
            unmet lmul selection expectations.
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c: Likewise,
            and drop start/end patterns.
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c: XFAIL
            missing Maximum lmul messages.
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c: Likewise.
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c: Drop
            Maximum lmul = 8 message.  Likewise.
            * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c: Likewise.
            * gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c: XFAIL unexpected
            selections of lmul, and of return insn.
            * gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c: XFAIL unexpected
            selection of lmul.

Diff:
---
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c  | 2 +-
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c  | 6 ++----
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c  | 4 ++--
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c  | 4 ++--
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c  | 4 ++--
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c | 1 -
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c | 5 ++---
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c       | 6 +++---
 gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c       | 4 ++--
 9 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c
index b5a7f180228a..85e3021f1c2b 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c
@@ -45,4 +45,4 @@ void foo2 (int64_t *__restrict a,
 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it 
has unexpected spills" "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c
index c4cb2081f930..387c3847cf27 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c
@@ -39,11 +39,9 @@ void foo2 (int16_t *__restrict a,
     }
 }
 
-/* { dg-final { scan-assembler {e16,m2} } } */
+/* { dg-final { scan-assembler {e16,m2} { xfail *-*-* } } } */
 /* { dg-final { scan-assembler-not {csrr} } } */
-/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it 
has unexpected spills" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it 
has unexpected spills" 1 "vect" { xfail *-*-* } } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
-/* { dg-final { scan-tree-dump "start = 8, end = 10" "vect" } } */
-/* { dg-final { scan-tree-dump "2: type = unsigned short, start = 0, end = 34" 
"vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c
index 3734b5c18a74..365fdf2a7498 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c
@@ -25,5 +25,5 @@ foo (uint8_t *restrict a, uint8_t *restrict b, int n)
 /* Since we don't support VLA SLP for LMUL = 8, dynamic LMUL cost model start 
from LMUL = 4.  */
 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it 
has unexpected spills" "vect" } } */
 /* { dg-final { scan-tree-dump-not "Maximum lmul = 8" "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" { xfail *-*-* 
} } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" { xfail *-*-* 
} } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c
index 1d37a516a76f..259885f67395 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c
@@ -39,9 +39,9 @@ void foo2 (int8_t *__restrict a,
     }
 }
 
-/* { dg-final { scan-assembler {e64,m4} } } */
+/* { dg-final { scan-assembler {e64,m4} { xfail *-*-* } } } */
 /* { dg-final { scan-assembler-not {csrr} } } */
-/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it 
has unexpected spills" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it 
has unexpected spills" 1 "vect" { xfail *-*-* } } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c
index 756176d42126..727f66de5ae1 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c
@@ -34,5 +34,5 @@ foo (uint8_t *restrict a, uint8_t *restrict b, int n)
 /* Since we don't support VLA SLP for LMUL = 8, dynamic LMUL cost model start 
from LMUL = 4.  */
 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it 
has unexpected spills" "vect" } } */
 /* { dg-final { scan-tree-dump-not "Maximum lmul = 8" "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" { xfail *-*-* 
} } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" { xfail *-*-* 
} } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c
index bd5aa80f0ba1..c5e78a12ac6e 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c
@@ -17,6 +17,5 @@ foo (int *x, int n, int res)
 /* { dg-final { scan-assembler {e32,m8} } } */
 /* { dg-final { scan-assembler-times {csrr} 1 } } */
 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it 
has unexpected spills" "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c
index 9fa6b69a7c9d..c55546394deb 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c
@@ -20,6 +20,5 @@ foo (int *restrict a, int *restrict b, int n)
 /* { dg-final { scan-assembler {e32,m8} } } */
 /* { dg-final { scan-assembler-times {csrr} 1 } } */
 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it 
has unexpected spills" "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" { xfail *-*-* 
} } } */
+/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" { xfail *-*-* 
} } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c
index 86241e705767..03d9f020bffd 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c
@@ -15,6 +15,6 @@ void bad1(int v1, int v2)
     }
 }
 
-/* { dg-final { scan-assembler {e32,m2} } } */
-/* { dg-final { scan-assembler-not {jr} } } */
-/* { dg-final { scan-assembler-times {ret} 1 } } */
+/* { dg-final { scan-assembler {e32,m2} { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not {jr} { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times {ret} 1 { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c 
b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c
index 6fd47f07a997..2c91987480bf 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c
@@ -21,8 +21,8 @@ void move_replacements (rtx *x, rtx *y, int n_replacements)
       }
 }
 
-/* { dg-final { scan-assembler-not {e64,m2} } } */
-/* { dg-final { scan-assembler {e64,m4} } } */
+/* { dg-final { scan-assembler-not {e64,m2} { xfail *-*-* } } } */
+/* { dg-final { scan-assembler {e64,m4} { xfail *-*-* } } } */
 /* { dg-final { scan-assembler-not {jr} } } */
 /* { dg-final { scan-assembler {ret} } } */
 /* { dg-final { scan-assembler-not {sp} } } */

Reply via email to