On 02/02/2017 03:32 PM, Jakub Jelinek wrote:
On Thu, Feb 02, 2017 at 10:12:32AM -0700, Jeff Law wrote:
On 02/01/2017 03:45 AM, Richard Biener wrote:
I agree. But this means we should look for a vectorizer-local fix
without a new global predicate then (there seem to be subtly different
needs and coming up with good names for all of them sounds difficult...).
Well, we could go with Jakub's INTEGRAL_BOOLEAN_TYPE as posted, but in
contexts where we use it and really depend on single bit objects, we add the
precision == 1 check back. Jakub's patch removes the type precision check
in tree-vect-patterns for example. There's likely all kinds of places where
we need to add that check as well.
The 3 cases in tree-vect-patterns.c where I've removed the check were
exactly what the proposed macro does, i.e.
if ((TYPE_PRECISION (TREE_TYPE (rhs1)) != 1
|| !TYPE_UNSIGNED (TREE_TYPE (rhs1)))
&& TREE_CODE (TREE_TYPE (rhs1)) != BOOLEAN_TYPE)
return false;
i.e. bail out unless the rhs1 type is a BOOLEAN_TYPE (any precision,
assuming it has only valid values of 0 and 1) or unless it is unsigned
precision type 1 integer (i.e. something that (if it has also QImode)
forwprop etc. could have changed a BOOLEAN_TYPE with precision 1 into.
Doh! I should have read those hunks more closely. Sorry for creating
the lengthier than necessary discussion.
Jeff