https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111114

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Lehua Ding from comment #4)
> Just to double check, are you saying something like the bellow? But I don't
> feel like the purpose is quite the same though. The match here was supposed
> to remove the CONVERT operation. Whereas I was hoping to reverse the order
> in order to combine them. 
> 
> ```
> (simplify
>  (convert (vec_cond:s @0 @1 @2))
>  (if (VECTOR_TYPE_P (type)
>       && types_match (TREE_TYPE (@0), truth_type_for (type))
>       && (TREE_CODE (@1) == VECTOR_CST || TREE_CODE (@2) == VECTOR_CST))
>    (vec_cond @0 (convert @1) (convert @2))))
> ```

Before any changes, we currently get:
  vect__5.14_56 = .MASK_LEN_LOAD (vectp_a.12_54, 8B, mask__24.11_52, _67, 0);
  vect_patt_40.15_58 = VEC_COND_EXPR <mask__24.11_52, vect__5.14_56, { 1, 1, 1,
1, 1, 1, 1, 1 }>;
  vect_patt_41.16_59 = (vector(8) short unsigned int) vect_patt_40.15_58;

I assumed you want to push that convert to be before the VEC_COND_EXPR,
correct?
If so the above match pattern should do that. The check for VECTOR_CST here is
mainly so we can the same # of convert expressions show up.

Reply via email to