Hi Juzhe, >>> Yes, we just wants to add the whole vector register length in bytes. > OK, I learn it and appreciate you give me the information. > >>> I wonder if you also want WHILE_LEN to have the implicit effect >>>to update vector length register? >>>From this perspective, Richi's >>>suggestion on "tieing the scalar result with the uses" looks better IMHO. > No, I don't want to make WHILE_LEN have implict side-effect. > Just tieing the scalar result with the uses. > Updating vector length register, I let RISC-V backend port to do that. > I don't want to involve any RISC-V specific feature into GCC middle-end. >
Good, thanks for clarifying, that makes more sense. >>>No, for both cases, IV is variable, the dumping at loop2_doloop for the >>>proposed sequence says >>>"Doloop: Possible infinite iteration case.", it seems to show that for the >>>proposed sequence compiler >>>isn't able to figure out the loop is finite, it may miss the range >>>information on n, or it isn't >>>able to analyze how the invariant involves, but I didn't look into it, all >>>my guesses. > Ok, I think it may be fixed in the future. Yeah, it can be. It only matters for us when adopting --param vect-partial-vector-usage=2 but it's not default. > > So, I wonder whether you are basically agree with the concept of this patch? > Would you mind giving more suggestions that I can fix this patch to make > more benefits for IBM (s390 or rs6000)? > For example, will you try this patch to see whether it can work for IBM in > case of multiple rgroup of SLP? The concept looks good to me, for IBM ports, it can benefit the length preparation for the case of --param vect-partial-vector-usage=2 (excepting for possible missing doloop chance), it's neutral for the case of --param vect-partial-vector-usage=1. IMHO, if possible you can extend the current function vect_set_loop_controls_directly rather than adding a new function vect_set_loop_controls_by_while_len, since that function does handle both masks and lengths (controls). And as vect_gen_len's comments shows, once you change the length preparation, you have to adjust the corresponding costs as well. And sure, once this becomes stable (all decisions from the discussions settled down, gets fully reviewed in stage 1), I'll test it on Power10 and get back to you. BR, Kewen