]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: riscv: adjust/xfail dynamic-lmul tests
authorAlexandre Oliva <oliva@adacore.com>
Sun, 1 Feb 2026 07:35:09 +0000 (04:35 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Sun, 1 Feb 2026 07:35:09 +0000 (04:35 -0300)
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.

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-5.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-6.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-7.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-8.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-10.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul8-12.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-3.c
gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c

index b5a7f180228a27b7a887af48ba1f891f3ae22db6..85e3021f1c2b671aa4b026bd5dc6646c8d792357 100644 (file)
@@ -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" } } */
index c4cb2081f93093f786bda90dcb674326b993f1c1..387c3847cf27e147cbb753084181b5a29196eb52 100644 (file)
@@ -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" } } */
index 3734b5c18a745df3ae933541e29bcefe0bffe621..365fdf2a74988dd395b001b60a72d1e7535eb11c 100644 (file)
@@ -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 *-*-* } } } */
index 1d37a516a76f19d76f17f2f6121570418e884cab..259885f67395b93b179c2ffb9c975daa317a320b 100644 (file)
@@ -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" } } */
index 756176d421265c9c74df9d18c6faecf24a7c81c1..727f66de5ae1d41982229a5506acac8dedcc1dbc 100644 (file)
@@ -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 *-*-* } } } */
index bd5aa80f0ba1f1356bf29ef45bad560373bc3910..c5e78a12ac6e35ec4aefab0b7f288e5e6ab44e9e 100644 (file)
@@ -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" } } */
index 9fa6b69a7c9da5940d61631400b670512125e0f7..c55546394debedbef9df2999d91a805a6f614384 100644 (file)
@@ -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 *-*-* } } } */
index 86241e705767776ca997254a5bb635537b230ab1..03d9f020bffdc17cdadcef8af930ae58c2ba75ee 100644 (file)
@@ -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 *-*-* } } } */
index 6fd47f07a99708e758ae5b328d46cf17746037c8..2c91987480bfd1b8fea6764de992116112fb0933 100644 (file)
@@ -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} } } */