> I see, didn't aware of that. I am not sure if we need to consider vsetvl here? > As there are extra 2 insn here.
I wouldn't consider it as it's outside of the loop. What matters is latency inside the loop. > I see, need to consider the cost here. Any example I can reference? Sorry I > haven't touch cost model in previous. Refer to riscv_rtx_costs. We set all vector instruction costs to 1. What you would need to do is pattern-match scalar (broadcast) operands inside our IF_THEN_ELSE vector patterns. There are a some scalar examples that show how it's done in principle. Then make use of either get_vector_costs ()->regmove->GR2VR; or riscv_register_move_cost to increase the pattern cost respectively. -- Regards Robin