Hi Juzhe, > Hi, Kewen. > >>> Sorry for chiming in, I had some concern here. >>> We already have some handlings for partial vector in length in >>> vect_set_loop_controls_directly >>>(actually it deals with both mask and length), the proposed >>>vect_set_loop_controls_by_select_vl >>>for select_vl looks like a variant for partial vector in length (comparing >>>to the normal MIN), >>>and also adopts decrement IV. IMHO, it seems better to modify/extend the >>>current handling in >>>vect_set_loop_controls_directly for length, or factor out the handlings for >>>length there and >>>extend the factored one. Otherwise, it means we have two sets of handlings >>>for partial vector >>>in lengths, it looks bad to maintain. As the previous discussion, adopting >>>decrement IV is an >>>enhancement for loop control, it's good for both cases w/ or w/o select_vl. >>>If the above >>>understanding is correct, the possible steps seem to be: >>> - factor out the handling for length (* optional) >>> - modify it with decrement IV >>> - extend it with select_vl. >>>In future if some RVV vendor wants to degenerate select_vl to min, it can >>>just adopt the same >>>handlings with min by not defining select_vl optab. > > You mean like this: > doing this inside vect_set_loop_controls_directly ? > if (use_while_len_p) > return vect_set_loop_controls_by_while_len(...)
No, I meant either factoring out those handlings for partial vector in length in function vect_set_loop_controls_directly to one separated function like: vect_set_loop_controls_directly_length and rename the existing one to vect_set_loop_controls_directly_mask, or keep the existing vect_set_loop_controls_directly for both mask and length but modify/extend the part for length. If there is no much code to share between mask and length, the former may be better. BR, Kewen