liuhongt c13223b790 Extend vectorizer to handle nonlinear induction for neg, mul/lshift/rshift with a constant.
For neg, the patch create a vec_init as [ a, -a, a, -a, ...  ] and no
vec_step is needed to update vectorized iv since vf is always multiple
of 2(negative * negative is positive).

For shift, the patch create a vec_init as [ a, a >> c, a >> 2*c, ..]
as vec_step as [ c * nunits, c * nunits, c * nunits, ... ], vectorized iv is
updated as vec_def = vec_init >>/<< vec_step.

For mul, the patch create a vec_init as [ a, a * c, a * pow(c, 2), ..]
as vec_step as [ pow(c,nunits), pow(c,nunits),...] iv is updated as vec_def =
vec_init * vec_step.

The patch handles nonlinear iv for
1. Integer type only, floating point is not handled.
2. No slp_node.
3. iv_loop should be same as vector loop, not nested loop.
4. No UD is created, for mul, use unsigned mult to avoid UD, for
   shift, shift count should be less than type precision.

gcc/ChangeLog:

	PR tree-optimization/103144
	* tree-vect-loop.cc (vect_is_nonlinear_iv_evolution): New function.
	(vect_analyze_scalar_cycles_1): Detect nonlinear iv by upper function.
	(vect_create_nonlinear_iv_init): New function.
	(vect_peel_nonlinear_iv_init): Ditto.
	(vect_create_nonlinear_iv_step): Ditto
	(vect_create_nonlinear_iv_vec_step): Ditto
	(vect_update_nonlinear_iv): Ditto
	(vectorizable_nonlinear_induction): Ditto.
	(vectorizable_induction): Call
	vectorizable_nonlinear_induction when induction_type is not
	vect_step_op_add.
	* tree-vect-loop-manip.cc (vect_update_ivs_after_vectorizer):
	Update nonlinear iv for epilogue loop.
	* tree-vectorizer.h (enum vect_induction_op_type): New enum.
	(STMT_VINFO_LOOP_PHI_EVOLUTION_TYPE): New Macro.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr103144-mul-1.c: New test.
	* gcc.target/i386/pr103144-mul-2.c: New test.
	* gcc.target/i386/pr103144-neg-1.c: New test.
	* gcc.target/i386/pr103144-neg-2.c: New test.
	* gcc.target/i386/pr103144-shift-1.c: New test.
	* gcc.target/i386/pr103144-shift-2.c: New test.
2022-09-07 08:38:18 +08:00
2022-03-19 00:16:22 +00:00
2022-09-01 00:17:39 +00:00
2022-09-01 00:17:39 +00:00
2022-09-01 00:17:39 +00:00
2022-09-01 00:17:39 +00:00
2022-08-31 00:16:45 +00:00
2022-07-13 00:16:33 +00:00
2021-11-30 00:16:44 +00:00
2022-08-26 00:16:21 +00:00
2022-08-31 00:16:45 +00:00
2022-07-09 00:16:54 +00:00
2022-06-28 00:16:58 +00:00
2022-06-04 00:16:27 +00:00
2022-09-06 00:17:07 +00:00
2022-05-21 00:16:32 +00:00
2021-11-16 00:16:31 +00:00
2022-09-01 00:17:39 +00:00
2022-08-27 00:17:09 +00:00
2022-07-30 10:35:23 -07:00
2022-09-06 00:17:07 +00:00
2022-08-26 00:16:21 +00:00
2022-09-01 00:17:39 +00:00
2022-08-26 00:16:21 +00:00
2022-08-26 00:16:21 +00:00
2022-08-28 00:16:28 +00:00
2022-08-26 00:16:21 +00:00
2022-09-05 00:16:27 +00:00
2022-08-26 00:16:21 +00:00
2022-09-07 00:17:51 +00:00
2022-08-26 00:16:21 +00:00
2022-08-02 00:16:51 +00:00
2022-07-29 00:16:21 +00:00
2022-08-26 00:16:21 +00:00
2022-07-19 17:07:04 +03:00
2022-09-07 00:17:51 +00:00
2021-12-21 09:10:57 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%