https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123822
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > There is a missed optimization on the gimple level:
> Note this missed optimization is what is exposing the issue though.
> because later on we figure out _16 (or is it _22) being -1 which causes the
> vec_concat to be created and then we are trying to take the lower part of
> that vec_concat into DD mode.
I think having a scalar subreg of a vector is questionable (unless it is for
the lowpart?). That said, it does look like it should work out OK.
I guess
_6 = VEC_COND_EXPR <_5, { -1, -1 }, { 0, 0 }>;
is V_C_E <_5> for a certain setup of modes. But I thought we already have
such pattern. Aka, if TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (@0)).
Ah, we have
/* Canonicalize mask ? { 0, ... } : { -1, ...} to ~mask if the mask
types are compatible. */
(simplify
(vec_cond @0 VECTOR_CST@1 VECTOR_CST@2)
(if (VECTOR_BOOLEAN_TYPE_P (type)
&& types_match (type, TREE_TYPE (@0)))
(if (integer_zerop (@1) && integer_all_onesp (@2))
(bit_not @0)
(if (integer_all_onesp (@1) && integer_zerop (@2))
@0))))
as closest.