Hi, Updated to v3 according to 2/4's param change. BR, Kewen ----------- gcc/ChangeLog 2020-MM-DD Kewen Lin * tree-ssa-loop-ivopts.c (struct iv_group): New field reg_offset_p. (struct iv_cand): New field reg_offset_p. (struct ivopts_data): New field consider_reg_offset_for_unroll_p. (dump_groups): Dump group with reg_offset_p. (record_group): Initialize reg_offset_p. (mark_reg_offset_groups): New function. (find_interesting_uses): Call mark_reg_offset_groups. (add_candidate_1): Update reg_offset_p if derived from reg_offset_p group. (set_group_iv_cost): Scale up group cost with estimate_unroll_factor if consider_reg_offset_for_unroll_p. (determine_iv_cost): Increase step cost with estimate_unroll_factor if consider_reg_offset_for_unroll_p. (tree_ssa_iv_optimize_loop): Call estimate_unroll_factor, update consider_reg_offset_for_unroll_p. on 2020/2/25 ÏÂÎç5:48, Kewen.Lin wrote: > Hi, > > As the proposed hook changes, updated this with main changes: > 1) Check with addr_offset_valid_p instead. > 2) Check the 1st and the last use for the whole address group. > 3) Scale up group costs accordingly. > > Bootstrapped/regtested on powerpc64le-linux-gnu (LE). > > BR, > Kewen > ----------- > > gcc/ChangeLog > > 2020-02-25 Kewen Lin > > * tree-ssa-loop-ivopts.c (struct iv_group): New field reg_offset_p. > (struct iv_cand): New field reg_offset_p. > (struct ivopts_data): New field consider_reg_offset_for_unroll_p. > (dump_groups): Dump group with reg_offset_p. > (record_group): Initialize reg_offset_p. > (mark_reg_offset_groups): New function. > (find_interesting_uses): Call mark_reg_offset_groups. > (add_candidate_1): Update reg_offset_p if derived from reg_offset_p group. > (set_group_iv_cost): Scale up group cost with estimate_unroll_factor if > consider_reg_offset_for_unroll_p. > (determine_iv_cost): Increase step cost with estimate_unroll_factor if > consider_reg_offset_for_unroll_p. > (tree_ssa_iv_optimize_loop): Call estimate_unroll_factor, update > consider_reg_offset_for_unroll_p. >