https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97194
--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Hongtao.liu from comment #15) > I'm working on add the expander, i encounter a problem. > > for V32HI vec_set with constant index, the expander existed under > TARGET_AVX512F, but for variable index, the expander should be existed under > TARGET_AVX512BW, since vpcmpw zmm only existed in TARGET_AVX512BW, we need > to restricted the expander under TARGET_AVX512BW, unfortunately operands is > unvisible in condition scope, any solution to handle such issue? can_vec_set_var_idx_p checks insn_operand_matches thus the operand predicate is what you should adjust I think, sth like "const_int_or_reg_for_vec_set_operand" or do you mean you do not see the mode of the vector inside the predicate? In that case I think you need to split the pattern? Or think of a way to implement byte/word insert with just AVVX512F ...