[PATCH v2 1/4] Fix loop split incorrect count and probability

2021-10-26 Thread Xionghu Luo via Gcc-patches
loop split condition is moved between loop1 and loop2, the split bb's count and probability should also be duplicated instead of (100% vs INV), secondly, the original loop1 and loop2 count need be propotional from the original loop. Regression tested pass, OK for master? diff base/loop-cond-split

[PATCH v2 2/4] Refactor loop_version

2021-10-26 Thread Xionghu Luo via Gcc-patches
loop_version currently does lv_adjust_loop_entry_edge before it loopifys the copy inserted on the header. This patch moves the condition generation later and thus we have four pieces to help understanding of how the adjustment works: 1) duplicating the loop on the entry edge. 2) loopify the dupl

[PATCH v2 3/4] Rename loop_version to clone_loop_to_header_edge.

2021-10-26 Thread Xionghu Luo via Gcc-patches
Name loop_copy is used in gcc/cfg.c already. gcc/ChangeLog: * cfgloopmanip.c (force_single_succ_latches): Rename loop_version to clone_loop_to_header_edge. (lv_adjust_loop_entry_edge): Likewise. (loop_version): Likewise. (clone_loop_to_header_edge): Likewis

[PATCH v2 4/4] Rename duplicate_loop_to_header_edge to duplicate_loop_body_to_header_edge

2021-10-26 Thread Xionghu Luo via Gcc-patches
gcc/ChangeLog: * cfghooks.c (cfg_hook_duplicate_loop_to_header_edge): Rename duplicate_loop_to_header_edge to duplicate_loop_body_to_header_edge. (cfg_hook_duplicate_loop_body_to_header_edge): Likewise. * cfghooks.h (struct cfg_hooks): Likewise. (cfg

<    1   2