I' like to split this patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576488.html to two patches: 0001-Fix-loop-split-incorrect-count-and-probability.patch 0002-Don-t-move-cold-code-out-of-loop-by-checking-bb-coun.patch since they are solving two different things, please help to review the attached series. They show obvious performance improvement on both P8 and P9 for CPU2017, and I am not sure how it will affect other platforms like X86 and AArch64, it will be grateful if someone could try it. Thanks. Xionghu