[patch] PR37574 fix - vectorizer ICE
Dorit Nuzman
DORIT@il.ibm.com
Thu Sep 25 22:59:00 GMT 2008
Hi,
This is another vectorizer PR that has to do with an operand that has a
different type than the rest of the stmt/operation (thanks to Jakub for
analyzing the PR and finding out the problem!):
We use two different vector types when we build a vector of
constants/invariants to vectorize a constant/invariant operand of a stmt:
1. to determine how many elements are in the vector we use the vector-type
that had been assigned to the *stmt*
2. when calling build_vector/constructor we use the vector-type derived
from the type of the *operand*
Normally these two types are the same, but not always (which is when we
ICE):
- constant operands may have a type different than the type of the stmt,
but: it seems like in such cases it doesn't make a difference (i.e. the
constant can be operated on as if it has the same type as the stmt).
- invariant operands may have a type different than the type of the stmt
only in promotion/demotion/widening stmts, in which case there's special
handling in the respective transformation routines and it is the type of
the operand that should determine the vector-type.
This patch makes sure we use the same vector type for both 1 and 2 above:
for constants we use the *stmt* based vectype for both 1&2, and for
invariants we use the *operand* based vectype for both 1&2.
Passed bootstrap on ppc970-linux,
and passed bootstrap with vectorization enabled and the vectorizer
testsuite on i386-linux.
To be committed to mainline once passes full regression testing on
ppc970-linux.
Thanks To Ira for looking over the SLP bits,
dorit
ChangeLog:
2008-09-25 Dorit Nuzman <dorit@il.ibm.com>
* tree-vectorizer.c (vect_is_simple_use): Fix indentation.
* tree-vect-transform.c (vect_get_constant_vectors): Use vectype
instead of vector_type for constants. Take computation out of loop.
(vect_get_vec_def_for_operand): Use only vectype for constant case,
and use only vector_type for invariant case.
(get_initial_def_for_reduction): Use vectype instead of vector_type.
testsuite ChangeLog:
2008-09-25 Dorit Nuzman <dorit@il.ibm.com>
* gcc.dg/vect/ggc-pr37574.c: New test.
* gcc.dg/vect/vect.exp: Compile some tests with ggc flags.
(See attached file: pr37574fix.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr37574fix.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080925/7bb312b3/attachment.txt>
More information about the Gcc-patches
mailing list