Hi! Yes, you can just use estimate_num_loop_insns afaics.
On Wed, May 20, 2020 at 11:58:20AM +0800, Jiufu Guo wrote: > if (unroll_only_small_loops && optimize == 2) > { > if (maxiter >= 4 > - && !(TREE_CODE (niter) == INTEGER_CST && single_exit (loop))) > + && !(TREE_CODE (niter) == INTEGER_CST && num_stmt_in_loop (loop) < 24 > + && single_exit (loop))) Please right this with both && in the inner condition on their own line, like if (maxiter >= 4 && !(TREE_CODE (niter) == INTEGER_CST && single_exit (loop) && num_stmt_in_loop (loop) < 24)) (also keep the single_exit test first, it is a simpler thing, in code executed but conceptually as well). Looks fine then. Segher