> +;; ----------------------------------------------------------------- > +;; ---- Duplicate Operations > +;; ----------------------------------------------------------------- > + > +(define_insn_and_split "@vec_duplicate<mode>" > + [(set (match_operand:VLS 0 "register_operand") > + (vec_duplicate:VLS > + (match_operand:<VEL> 1 "reg_or_int_operand")))] > + "TARGET_VECTOR && can_create_pseudo_p ()" > + "#" > + "&& 1" > + [(const_int 0)] > + { > + riscv_vector::emit_vlmax_insn (code_for_pred_broadcast (<MODE>mode), > + riscv_vector::RVV_UNOP, operands); > + DONE; > + } > +)
Ah, nice. The same thing helps for vv -> vx (for non-VLS modes) because we can keep the non-expanded version around longer which allows more fwprop opportunities. > + /* Enable VECT_COMPARE_COSTS between VLA modes VLS modes for scalable > + auto-vectorization. */ > + flag |= VECT_COMPARE_COSTS; I think it's good to activate this here for now. After a while when costing is reliable we probably want to have it unconditionally even for pure scalable/fixed-vlmax. Regards Robin