[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2024-01-24 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

Patrick O'Neill  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

--- Comment #20 from Patrick O'Neill  ---
Closing my old tracking issues.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-12-11 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

Patrick O'Neill  changed:

   What|Removed |Added

  Attachment #56794|0   |1
is obsolete||

--- Comment #19 from Patrick O'Neill  ---
Created attachment 56855
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56855=edit
rv64gcv_zvl512b testsuite failures 2023-12-10

Tested with hash fbfe43daec6443978df65530dc5f7f3f8a4e6f9e
CI run:
https://github.com/patrick-rivos/gcc-postcommit-ci/actions/runs/7158896306

Comparison with zvl128b (pr112583):

Resolved failures (present on zvl128b but not zvl512b):
XPASS: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;"
XPASS: gcc.dg/vect/bb-slp-68.c -flto -ffat-lto-objects  scan-tree-dump-not slp2
"from scalars"
XPASS: gcc.dg/vect/bb-slp-68.c scan-tree-dump-not slp2 "from scalars"
FAIL: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects  scan-tree-dump-times
vect "loop vectorized" 2
FAIL: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump-times vect "loop vectorized" 2
FAIL: gcc.dg/vect/bb-slp-pr65935.c -flto -ffat-lto-objects 
scan-tree-dump-times slp1 "optimized: basic block" 11
FAIL: gcc.dg/vect/bb-slp-pr65935.c scan-tree-dump-times slp1 "optimized: basic
block" 11
FAIL: gcc.dg/vect/bb-slp-subgroups-2.c -flto -ffat-lto-objects 
scan-tree-dump-times slp2 "optimized: basic block" 1
FAIL: gcc.dg/vect/bb-slp-subgroups-2.c scan-tree-dump-times slp2 "optimized:
basic block" 1
XPASS: gcc.dg/vect/bb-slp-subgroups-3.c -flto -ffat-lto-objects 
scan-tree-dump-times slp2 "optimized: basic block" 2
XPASS: gcc.dg/vect/bb-slp-subgroups-3.c scan-tree-dump-times slp2 "optimized:
basic block" 2
FAIL: gcc.dg/vect/pr66251.c -flto -ffat-lto-objects  scan-tree-dump-times vect
"vectorized 1 loops" 2
FAIL: gcc.dg/vect/pr66251.c scan-tree-dump-times vect "vectorized 1 loops" 2

New failures (present on zvl512b but not zvl128b):
FAIL: gfortran.dg/matmul_1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/matmul_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -g  execution test
FAIL: gfortran.dg/vect/pr83232.f90   -O   scan-tree-dump-times slp1
"vectorizing stmts using SLP" 3
FAIL: gcc.dg/no-strict-overflow-6.c scan-tree-dump optimized "return 0"
FAIL: gcc.dg/pr30957-1.c execution test
FAIL: gcc.dg/pr30957-1.c scan-rtl-dump loop2_unroll "Expanding Accumulator"
FAIL: gcc.dg/tree-ssa/ivopts-lt-2.c scan-tree-dump-times ivopts "PHI 

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-12-04 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

Patrick O'Neill  changed:

   What|Removed |Added

  Attachment #56700|0   |1
is obsolete||

--- Comment #18 from Patrick O'Neill  ---
Created attachment 56794
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56794=edit
rv64gcv_zvl512b testsuite failures 2023-12-03

Tested with hash 806789e6daa39ab0503d91c71b3faeb5d5cdd317
CI run:
https://github.com/patrick-rivos/gcc-postcommit-ci/actions/runs/7077949347

Comparison with zvl128b (pr112583):

Resolved failures (present on zvl128b but not zvl512b):
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++14  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++17  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++20  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++98  scan-tree-dump optimized
"return 15;"
XPASS: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;"

New failures (present on zvl512b but not zvl128b):
FAIL: gfortran.dg/matmul_1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/matmul_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -g  execution test
FAIL: gcc.c-torture/compile/20090907-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: in partial_subreg_p, at rtl.h:3187)
FAIL: gcc.c-torture/compile/20090907-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: gcc.dg/no-strict-overflow-6.c scan-tree-dump optimized "return 0"
FAIL: gcc.dg/pr30957-1.c execution test
FAIL: gcc.dg/pr30957-1.c scan-rtl-dump loop2_unroll "Expanding Accumulator"
FAIL: gcc.dg/tree-ssa/ivopts-lt-2.c scan-tree-dump-times ivopts "PHI  i" 2
FAIL: gcc.dg/torture/pr58955-2.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gcc.dg/tree-prof/time-profiler-3.c scan-ipa-dump-times profile "Read
tp_first_run: 0" 1
FAIL: gcc.dg/tree-prof/time-profiler-3.c scan-ipa-dump-times profile "Read
tp_first_run: 2" 1


New failures:
FAIL: gcc.target/riscv/rvv/autovec/pr112552.c -O3 -ftree-vectorize (test for
excess errors)

This new failure is also seen on pr112583 - looks like a simple issue.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #17 from Li Pan  ---
(In reply to Robin Dapp from comment #15)
> Does the =m fix your issue?  Or is the code gen different then and we're
> just lucky?  For my problem it doesn't help because we still don't recognize
> an alias between load and store and the load is moved.
> 
> Richi's RFC patch from a while ago helps, though.  I cc'd you.

No, it should be something that happens to work. I double-checked the asm
layout, the alias is still false between scalar load and vector store.

   1016e:   158000efjal 102c6 
   10172:   ffc50793add a5,a0,-4
   10176:   4689li  a3,2
   10178:   0d047057vsetvli zero,s0,e32,m1,ta,ma
   1017c:   40d8lw  a4,4(s1)<= LOAD
   1017e:   5e00b0d7vmv.v.i v1,1
   10182:   74d1a423sw  a3,1864(gp) # 13398 
   10186:   0207e0a7vse32.v v1,(a5) <=
STORE
   1018a:   03271163bne a4,s2,101ac 

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

Patrick O'Neill  changed:

   What|Removed |Added

  Attachment #56661|0   |1
is obsolete||

--- Comment #16 from Patrick O'Neill  ---
Created attachment 56700
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56700=edit
rv64gcv_zvl512b testsuite failures 2023-11-25

Tested with hash 9866c98e1015d98b8fc346d7cf73a0070cce5f69
CI run:
https://github.com/patrick-rivos/gcc-postcommit-ci/actions/runs/6988591247

Comparison with zvl128b (pr112583):

Resolved failures (present on zvl128b but not zvl256b):
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++14  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++17  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++20  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++98  scan-tree-dump optimized
"return 15;"
XPASS: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;"

New failures (present on zvl256b but not zvl128b):
FAIL: gfortran.dg/class_67.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/matmul_1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/matmul_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -g  execution test
FAIL: gcc.c-torture/compile/20090907-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: in partial_subreg_p, at rtl.h:3187)
FAIL: gcc.c-torture/compile/20090907-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: gcc.dg/no-strict-overflow-6.c scan-tree-dump optimized "return 0"
FAIL: gcc.dg/pr30957-1.c execution test
FAIL: gcc.dg/pr30957-1.c scan-rtl-dump loop2_unroll "Expanding Accumulator"
FAIL: gcc.dg/torture/pr58955-2.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gcc.dg/tree-ssa/ivopts-lt-2.c scan-tree-dump-times ivopts "PHI 

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #15 from Robin Dapp  ---
Does the =m fix your issue?  Or is the code gen different then and we're just
lucky?  For my problem it doesn't help because we still don't recognize an
alias between load and store and the load is moved.

Richi's RFC patch from a while ago helps, though.  I cc'd you.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #14 from Li Pan  ---
The below diff similar to the x86 workaround looks not working, unless we
change the `+m` to `=m`. But I don't fully test the impact of this change
except the case itself.

diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
index 935eeb7fd8e..882fc8fe5ec 100644
--- a/gcc/config/riscv/riscv.md
+++ b/gcc/config/riscv/riscv.md
@@ -85,6 +85,9 @@ (define_c_enum "unspec" [

   ;; String unspecs
   UNSPEC_STRLEN
+
+  ;; test
+  UNSPEC_MASKSTORE
 ])

 (define_c_enum "unspecv" [
diff --git a/gcc/config/riscv/vector.md b/gcc/config/riscv/vector.md
index ba9c9e5a9b6..2f74cec51d1 100644
--- a/gcc/config/riscv/vector.md
+++ b/gcc/config/riscv/vector.md
@@ -1738,16 +1738,17 @@ (define_insn_and_split "*pred_mov"
 ;; Dedicated pattern for vse.v instruction since we can't reuse pred_mov
pattern to include
 ;; memory operand as input which will produce inferior codegen.
 (define_insn "@pred_store"
-  [(set (match_operand:V 0 "memory_operand" "+m")
-   (if_then_else:V
- (unspec:
-   [(match_operand: 1 "vector_mask_operand" "vmWc1")
-(match_operand 3 "vector_length_operand""   rK")
-(match_operand 4 "const_int_operand""i")
-(reg:SI VL_REGNUM)
-(reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)
- (match_operand:V 2 "register_operand" "vr")
- (match_dup 0)))]
+  [(set (match_operand:V 0 "memory_operand" "=m")
+   (unspec:V
+ [(if_then_else:V
+   (unspec:
+ [(match_operand: 1 "vector_mask_operand" "vmWc1")
+  (match_operand 3 "vector_length_operand""   rK")
+  (match_operand 4 "const_int_operand""i")
+  (reg:SI VL_REGNUM)
+  (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)
+   (match_operand:V 2 "register_operand" "vr")
+   (match_dup 0))] UNSPEC_MASKSTORE))]
   "TARGET_VECTOR"
   "vse.v\t%2,%0%p1"
   [(set_attr "type" "vste")

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #13 from Robin Dapp  ---
It looks like the takeaway from the other thread is that there are many
likewise assumptions about masked stores in the middle end.  It's probably
difficult to get them all right in a short time.  Therefore I suppose our only
choice is to go "UNSPEC" as well for now.  I'm also testing some quick hacks
locally.

What's the problem about the pred_store pattern you mention?  That we would
lose that particular optimization?

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #12 from Li Pan  ---
Hi Robin,

Do you have any ideas about the possible fix for this issue? The x86 backend
has one workaround for this issue as below.

https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=dbf8ab449417aa24669f6ccf50be8c17f8c1278e

But unfortunately not suitable for riscv after a quick try because of the below
define_insn:
 (define_insn "@pred_store"
   [(set (match_operand:V 0 "memory_operand" "+m") // "=m" here
for x86 SSE.

Given current stage of GCC, I am not quite sure if we need to fix it in the
backend (Or bypass it) or from the middle end.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-27 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #11 from Robin Dapp  ---
On Friday I looked into one of the Fortran fails, class_67.f90 and debugged it
independently without reading here further.  It is also due to the same reason
- alias analysis finds that the predicated store destination cannot alias with
the load destination and moves the load in front of the store.

  /* If the pointer based access is bigger than the variable they cannot
 alias.  This is similar to the check below where we use TBAA to
 increase the size of the pointer based access based on the dynamic
 type of a containing object we can infer from it.  */
  poly_int64 dsize2;
  if (known_size_p (size1)
  && poly_int_tree_p (DECL_SIZE (base2), )
  && known_lt (dsize2, size1))
return false;

This is where alias analysis "fails".  That looks like the exact same thing
posted in the other thread, so thanks for finding that, Pan.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-26 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #10 from Li Pan  ---
Link to one similar issue as below.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-23 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #9 from Li Pan  ---
Before tracer
- 
ENTRY
   |
   +---+
   |  B2   |
   +---+
  / \
a < 2a >= 2
/  \ 
   +---+  +---+
   | vec store |->| _3 = b[1] |
   +---+  +---+
  /\
_3 != 1 _3 == 1
/\
+++--+
| abort  || return 0 |
+++--+
After tracer
- 

ENTRY
   |
   +---+
   |  B2   |
   +---+
  / \
a < 2a >= 2
/  \ 
+-+  +---+
| vec store   |  | _3 = b[1] |
| |  +---+
after tracer| |   /\
| |_3 != 1 _3 == 1
| _31 = b[1]  | /\
+-+ +++--+
|-->| abort  || return 0 |<---|
|   +++--+|
| |
|-|

After tracer, the vec store and scalar load will be in the same basic block and
unfortunately referenced to the same memory address. Thus, the sch1 make the
scalar load before vec store cause the failure on memory access sequeneces.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-22 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #8 from Li Pan  ---
For gcc.dg/torture/pr58955-2.c, we can simply reproduce it by options

Pass when: -O3
Pass when: -O3 -ftracer -fno-schedule-insns -fno-schedule-insns2
Fail when: -O3 -ftracer -fno-schedule-insns2

   10154:   4409   li   s0,2
   10156:   9c1d   subw s0,s0,a5
   10158:   1402   sll  s0,s0,0x20
   1015a:   9001   srl  s0,s0,0x20
   1015c:   97ca   add  a5,a5,s2
   1015e:   078a   sll  a5,a5,0x2
   10160:   7b018493   add  s1,gp,1968 # 13400 
   10164:   97a6   add  a5,a5,s1
   10166:   00241613   sll  a2,s0,0x2
   1016a:   853e   mv   a0,a5
   1016c:   4581   li   a1,0
   1016e:   158000ef   jal  102c6 
   10172:   ffc50793   add  a5,a0,-4
   10176:   4689   li   a3,2
   10178:   0d047057   vsetvli  zero,s0,e32,m1,ta,ma
   1017c:   40d8   lw   a4,4(s1)<== Load
   1017e:   5e00b0d7   vmv.v.i  v1,1
   10182:   74d1a423   sw   a3,1864(gp) # 13398 
   10186:   0207e0a7   vse32.v  v1,(a5) <== Store
   1018a:   03271163   bne  a4,s2,101ac 

Looks like the tracer and the sch1 resulted in the failure, it is a typical
Load Before Store issue AFAIK. The lw load should be after the vse32 store in
semantics but the sch1 moves it before the store and of course, the value of a4
is unexpected here.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Pan Li :

https://gcc.gnu.org/g:de6f3e12bd188fee30bc79a5e323e16e0dbbe8ca

commit r14-5755-gde6f3e12bd188fee30bc79a5e323e16e0dbbe8ca
Author: Juzhe-Zhong 
Date:   Wed Nov 22 18:53:22 2023 +0800

RISC-V: Fix incorrect use of vcompress in permutation auto-vectorization

This patch fixes following FAILs on zvl512b of RV32 system:

FAIL: gcc.target/riscv/rvv/autovec/struct/struct_vect_run-12.c execution
test
FAIL: gcc.target/riscv/rvv/autovec/struct/struct_vect_run-9.c execution
test

The root cause is that for permutation indice = {0,3,7,0} use vcompress
optimization
which is incorrect. Fix vcompress optimization bug.

PR target/112598

gcc/ChangeLog:

* config/riscv/riscv-v.cc (shuffle_compress_patterns): Fix
vcompress bug.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr112598-3.c: New test.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-22 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #6 from JuzheZhong  ---
Hi, there are these following run FAILs left on RV32/RV64 C/C++:
after this patch fix:
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637753.html


FAIL: gcc.dg/vect/pr65518.c -flto -ffat-lto-objects execution test
This case I don't have a quick solution, so file a PR here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112670

This FAIL may need Robin's help.

Another FAIL is 
FAIL: gcc.dg/torture/pr58955-2.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test

Li Pan from intel will handle this FAIL.

So I am gonna move on zvl1024b.

Btw, could you run zvl2048b, zvl4096b (We can only allow VLEN at most 4096bit
for now) ? I didn't see a PR for these 2.

Thanks.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #5 from CVS Commits  ---
The trunk branch has been updated by Lehua Ding :

https://gcc.gnu.org/g:d13e59b86c5cbeec6135ada3f6dc983289cac610

commit r14-5748-gd13e59b86c5cbeec6135ada3f6dc983289cac610
Author: Juzhe-Zhong 
Date:   Wed Nov 22 11:27:52 2023 +0800

RISC-V: Fix permutation indice mode bug

This patch fixes following FAILs on zvl512b:
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-1.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-1.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-16.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-16.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-17.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-17.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-3.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-3.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-5.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-5.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-6.c execution test
FAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-6.c execution test

The root cause is that we are using vrgather.vv on vector QI mode which
is incorrect for zvl512b since it exceed 256.

Instead, we should use vrgatherei16.vv

PR target/112598

gcc/ChangeLog:

* config/riscv/riscv-v.cc (emit_vlmax_gather_insn): Adapt the
priority.
(shuffle_generic_patterns): Fix permutation indice bug.
* config/riscv/vector-iterators.md: Fix VEI16 bug.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr112598-2.c: New test.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-21 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

Patrick O'Neill  changed:

   What|Removed |Added

  Attachment #56625|0   |1
is obsolete||

--- Comment #4 from Patrick O'Neill  ---
Created attachment 56661
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56661=edit
rv64gcv_zvl512b testsuite failures 2023-11-21

This report does not include the fix by Juzhe.
Tested with hash 30d8188e6d1b450533ab0055b951ebfc75022219

Comparison with zvl128b (pr112583):

Resolved failures (present on zvl128b but not zvl512b):
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++14  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++17  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++20  scan-tree-dump optimized
"return 15;"
XPASS: g++.dg/tree-ssa/pr83518.C  -std=gnu++98  scan-tree-dump optimized
"return 15;"
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
execution test
FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
execution test
XPASS: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;"

New failures (present on zvl512b but not zvl128b):
FAIL: gfortran.dg/class_67.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/matmul_1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/matmul_1.f90   -O3 -g  execution test
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_3.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/maxval_char_4.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_3.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -g  (internal compiler error: in
duplicate_and_interleave, at tree-vect-slp.cc:8025)
FAIL: gfortran.dg/minval_char_4.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/proc_ptr_comp_12.f90   -O3 -g  execution test
FAIL: gcc.c-torture/compile/20090907-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: in partial_subreg_p, at rtl.h:3187)
FAIL: gcc.c-torture/compile/20090907-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: gcc.dg/no-strict-overflow-6.c scan-tree-dump optimized "return 0"
FAIL: gcc.dg/pr30957-1.c execution test
FAIL: gcc.dg/pr30957-1.c scan-rtl-dump loop2_unroll "Expanding Accumulator"
FAIL: gcc.dg/torture/pr58955-2.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer 

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Pan Li :

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

commit r14-5677-g8faae311a60a552ed3d506de28c50c77fa49b229
Author: Juzhe-Zhong 
Date:   Tue Nov 21 18:02:09 2023 +0800

RISC-V: Disallow COSNT_VECTOR for DI on RV32

This bug is exposed when testing on zvl512b RV32 system.

The rootcause is RA reload DI CONST_VECTOR into vmv.v.x then it ICE.

So disallow DI CONST_VECTOR on RV32.

PR target/112598

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_const_insns): Disallow DI
CONST_VECTOR on RV32.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr112598-1.c: New test.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-20 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #2 from JuzheZhong  ---
Since zvl128b and zvl256b bug fix are done.

So I am gonna work on zvl512b now.

[Bug target/112598] RISC-V regression testsuite errors with rv64gcv_zvl512b

2023-11-17 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598

--- Comment #1 from Patrick O'Neill  ---
Related issues:
128: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112583
256: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112597
512: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598
1024: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112599