re PR tree-optimization/88440 (size optimization of memcpy-like code)
authorRichard Biener <rguenther@suse.de>
Thu, 23 May 2019 11:35:16 +0000 (11:35 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 23 May 2019 11:35:16 +0000 (11:35 +0000)
commit5879ab5fafedc8f6f9bfe95a4cf8501b0df90edd
treee886bbae2a64b230962aaf93a1c7ceb9b88ece6e
parent32d941139e8144662e0dc182d64e3f3f9df89ad4
re PR tree-optimization/88440 (size optimization of memcpy-like code)

2019-05-23  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88440
* opts.c (default_options_table): Enable -ftree-loop-distribute-patterns
at -O[2s]+.
* tree-loop-distribution.c (generate_memset_builtin): Fold the
generated call.
(generate_memcpy_builtin): Likewise.
(distribute_loop): Pass in whether to only distribute patterns.
(prepare_perfect_loop_nest): Also allow size optimization.
(pass_loop_distribution::execute): When optimizing a loop
nest for size allow pattern replacement.

* gcc.dg/tree-ssa/ldist-37.c: New testcase.
* gcc.dg/tree-ssa/ldist-38.c: Likewise.
* gcc.dg/vect/vect.exp: Add -fno-tree-loop-distribute-patterns.
* gcc.dg/tree-ssa/ldist-37.c: Adjust.
* gcc.dg/tree-ssa/ldist-38.c: Likewise.
* g++.dg/tree-ssa/pr78847.C: Likewise.
* gcc.dg/autopar/pr39500-1.c: Likewise.
* gcc.dg/autopar/reduc-1char.c: Likewise.
* gcc.dg/autopar/reduc-7.c: Likewise.
* gcc.dg/tree-ssa/ivopts-lt-2.c: Likewise.
* gcc.dg/tree-ssa/ivopts-lt.c: Likewise.
* gcc.dg/tree-ssa/predcom-dse-1.c: Likewise.
* gcc.dg/tree-ssa/predcom-dse-2.c: Likewise.
* gcc.dg/tree-ssa/predcom-dse-3.c: Likewise.
* gcc.dg/tree-ssa/predcom-dse-4.c: Likewise.
* gcc.dg/tree-ssa/prefetch-7.c: Likewise.
* gcc.dg/tree-ssa/prefetch-8.c: Likewise.
* gcc.dg/tree-ssa/prefetch-9.c: Likewise.
* gcc.dg/tree-ssa/scev-11.c: Likewise.
* gcc.dg/vect/costmodel/i386/costmodel-vect-31.c: Likewise.
* gcc.dg/vect/costmodel/i386/costmodel-vect-33.c: Likewise.
* gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c: Likewise.
* gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c: Likewise.
* gcc.target/i386/pr30970.c: Likewise.
* gcc.target/i386/vect-double-1.c: Likewise.
* gcc.target/i386/vect-double-2.c: Likewise.
* gcc.dg/tree-ssa/gen-vect-2.c: Likewise.
* gcc.dg/tree-ssa/gen-vect-26.c: Likewise.
* gcc.dg/tree-ssa/gen-vect-28.c: Likewise.
* gcc.dg/tree-ssa/gen-vect-32.c: Likewise.
* gfortran.dg/vect/vect-5.f90: Likewise.
* gfortran.dg/vect/vect-8.f90: Likewise.

From-SVN: r271553
32 files changed:
gcc/ChangeLog
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr78847.C
gcc/testsuite/gcc.dg/autopar/pr39500-1.c
gcc/testsuite/gcc.dg/autopar/reduc-1char.c
gcc/testsuite/gcc.dg/autopar/reduc-7.c
gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt-2.c
gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c
gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-1.c
gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-2.c
gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-3.c
gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-4.c
gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c
gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c
gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
gcc/testsuite/gcc.dg/tree-ssa/scev-11.c
gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/testsuite/gcc.target/i386/pr30970.c
gcc/testsuite/gcc.target/i386/vect-double-1.c
gcc/testsuite/gcc.target/i386/vect-double-2.c
gcc/testsuite/gfortran.dg/vect/vect-5.f90
gcc/testsuite/gfortran.dg/vect/vect-8.f90
gcc/tree-loop-distribution.c