Hi, Sorry, please ignore the previously attached file, which isn't the latest one although almost are the same. The latest tested is attached here. Sorry for the inconvenience. BR, Kewen on 2020/7/22 下午11:48, Kewen.Lin via Gcc-patches wrote: > > It's a great idea, by following your subsequent suggestion to make the structure > like: > > - calculate peel_iters_prologue > - calculate peel_iters_epilogue > - add costs associated with peel_iters_prologue > - add costs associated with peel_iters_epilogue > - add costs related to branch taken/not_taken. > > the updated v3 is attached. > > Just bootstrapped/regtested on powerpc64le-linux-gnu (P9) with explicit > param vect-partial-vector-usage=1, I'll test it without partial vectors > setting, also on aarch64 later. > > BR, > Kewen > ----- > gcc/ChangeLog: > > * config/rs6000/rs6000.c (adjust_vect_cost_per_loop): New function. > (rs6000_finish_cost): Call adjust_vect_cost_per_loop. > * tree-vect-loop.c (vect_get_known_peeling_cost): Factor out some code > to determine peel_iters_epilogue to function ... > (vect_get_peel_iters_epilogue): ... this. New function. > (vect_estimate_min_profitable_iters): Add cost modeling for vector > with length, refactor cost calculation on peel_iters_prologue and > peel_iters_epilogue. >