This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r278234 - in /trunk/gcc: ChangeLog tree-vect-st...


Author: rsandifo
Date: Thu Nov 14 14:57:26 2019
New Revision: 278234

URL: https://gcc.gnu.org/viewcvs?rev=278234&root=gcc&view=rev
Log:
Use build_vector_type_for_mode in get_vectype_for_scalar_type_and_size

Except for one case, get_vectype_for_scalar_type_and_size calculates
what the vector mode should be and then calls build_vector_type,
which recomputes the mode from scratch.  This patch makes it use
build_vector_type_for_mode instead.

The exception mentioned above is when preferred_simd_mode returns
an integer mode, which it does if no appropriate vector mode exists.
The integer mode in question is usually word_mode, although epiphany
can return a doubleword mode in some cases.

There's no guarantee that this integer mode is appropriate, since for
example the scalar type could be a float.  The traditional behaviour is
therefore to use the integer mode to determine a size only, and leave
mode_for_vector to pick the TYPE_MODE.  (Note that it can actually end
up picking a vector mode if the target defines a disabled vector mode.
We therefore still need to check TYPE_MODE after building the type.)

2019-11-14  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): If
	targetm.vectorize.preferred_simd_mode returns an integer mode,
	use mode_for_vector to decide what the vector type's mode
	should actually be.  Use build_vector_type_for_mode instead
	of build_vector_type.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-vect-stmts.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]