https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113607
--- Comment #20 from JuzheZhong <juzhe.zhong at rivai dot ai> --- (In reply to Robin Dapp from comment #19) > What seems odd to me is that in fre5 we simplify > > _429 = .COND_SHL (mask_patt_205.47_276, vect_cst__262, vect_cst__262, { 0, > ... }); > vect_prephitmp_129.51_282 = _429; > vect_iftmp.55_287 = VEC_COND_EXPR <mask_patt_209.54_286, > vect_prephitmp_129.51_282, vect_cst__262>; > > to > > Applying pattern match.pd:9607, gimple-match-10.cc:3817 > gimple_simplified to vect_iftmp.55_287 = .COND_SHL (mask_patt_205.47_276, > vect_cst__262, vect_cst__262, { 0, ... }); > > so fold > > vec_cond (mask209, prephitmp129, vect_cst262) > with prephitmp129 = cond_shl (mask205, vect_cst262, vect_cst262, 0) > > into > cond_shl = (mask205, vect_cst262, vect_cst262, 0)? > > That doesn't look valid to me because the vec_cond's else value > (vect_cst262) gets lost. Wouldn't such a simplification have a conditional > else value? > Like !mask1 ? else1 : else2 instead of else2 unconditionally? Does ARM SVE have the same issue too ? Since I think we should be using same folding optimization as ARM SVE.