Skip to content

Commit

Permalink
target/109955 - handle pattern generated COND_EXPR without vcond
Browse files Browse the repository at this point in the history
The following properly handles pattern matching generated COND_EXPRs
which can still have embedded compares in vectorizable_condition
which will always code generate the masked vector variant.  We
were requiring vcond with embedded comparisons instead of also
allowing (as code generated) split compare and VEC_COND_EXPR.

This fixes some of the fallout when removing vcond{,u,eq} expanders
from the x86 backend.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	PR target/109955
	* tree-vect-stmts.cc (vectorizable_condition): For
	embedded comparisons also handle the case when the target
	only provides vec_cmp and vcond_mask.
  • Loading branch information
rguenth authored and ouuleilei-bot committed May 25, 2023
1 parent c2d62cd commit 488aabe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gcc/tree-vect-stmts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10819,7 +10819,12 @@ vectorizable_condition (vec_info *vinfo,
if (reduction_type == EXTRACT_LAST_REDUCTION)
/* Count one reduction-like operation per vector. */
kind = vec_to_scalar;
else if (!expand_vec_cond_expr_p (vectype, comp_vectype, cond_code))
else if (!expand_vec_cond_expr_p (vectype, comp_vectype, cond_code)
&& (masked
|| (!expand_vec_cmp_expr_p (comp_vectype, vec_cmp_type,
cond_code)
|| !expand_vec_cond_expr_p (vectype, vec_cmp_type,
ERROR_MARK))))
return false;

if (slp_node
Expand Down

0 comments on commit 488aabe

Please sign in to comment.