[Bug tree-optimization/88497] Improve Accumulation in Auto-Vectorized Code

2019-07-15 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88497

--- Comment #12 from Segher Boessenkool  ---
It still does some weird register moves (the xxlor and the fmr), but
those are totally different problems ;-)

[Bug tree-optimization/88497] Improve Accumulation in Auto-Vectorized Code

2019-07-14 Thread linkw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88497

Kewen Lin  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Kewen Lin  ---
For the code in comment 9, now it generates the below code with the committed
fix:

 :
   0:   11 00 04 f4 lxv vs0,16(r4)
   4:   11 00 c5 f4 lxv vs6,16(r5)
   8:   31 00 44 f5 lxv vs10,48(r4)
   c:   31 00 e5 f4 lxv vs7,48(r5)
  10:   01 00 84 f5 lxv vs12,0(r4)
  14:   01 00 05 f5 lxv vs8,0(r5)
  18:   21 00 64 f5 lxv vs11,32(r4)
  1c:   21 00 25 f5 lxv vs9,32(r5)
  20:   80 33 00 f0 xvmuldp vs0,vs0,vs6
  24:   80 3b 4a f1 xvmuldp vs10,vs10,vs7
  28:   08 43 0c f0 xvmaddadp vs0,vs12,vs8
  2c:   90 54 8a f1 xxlor   vs12,vs10,vs10
  30:   08 4b 8b f1 xvmaddadp vs12,vs11,vs9
  34:   00 63 00 f0 xvadddp vs0,vs0,vs12
  38:   90 00 80 fd fmr f12,f0
  3c:   50 03 00 f0 xxspltd vs0,vs0,1
  40:   2a 00 0c fc faddf0,f12,f0
  44:   2a 08 20 fc faddf1,f0,f1
  48:   20 00 80 4e blr

[Bug tree-optimization/88497] Improve Accumulation in Auto-Vectorized Code

2019-07-14 Thread linkw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88497

--- Comment #10 from Kewen Lin  ---
Author: linkw
Date: Mon Jul 15 05:12:05 2019
New Revision: 273490

URL: https://gcc.gnu.org/viewcvs?rev=273490&root=gcc&view=rev
Log:
gcc/ChangeLog

2019-07-15  Kewen Lin  

PR tree-optimization/88497
* tree-ssa-reassoc.c (reassociate_bb): Swap the positions of
GIMPLE_BINARY_RHS check and gimple_visited_p check, call new
function undistribute_bitref_for_vector.
(undistribute_bitref_for_vector): New function.
(cleanup_vinfo_map): Likewise.
(sort_by_mach_mode): Likewise.

gcc/testsuite/ChangeLog

2019-07-15  Kewen Lin  

PR tree-optimization/88497
* gcc.dg/tree-ssa/pr88497-1.c: New test.
* gcc.dg/tree-ssa/pr88497-2.c: Likewise.
* gcc.dg/tree-ssa/pr88497-3.c: Likewise.
* gcc.dg/tree-ssa/pr88497-4.c: Likewise.
* gcc.dg/tree-ssa/pr88497-5.c: Likewise.
* gcc.dg/tree-ssa/pr88497-6.c: Likewise.
* gcc.dg/tree-ssa/pr88497-7.c: Likewise.


Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-1.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-2.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-3.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-4.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-5.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-6.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88497-7.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-reassoc.c