> + /* if the latch contains more than the one statemnt of control
> + increment then it contains the body. */
> + if (exit_1->dest == loop->latch && last_and_only_stmt (loop->latch))
> new_rhs = gimple_cond_rhs (cond_stmt);
> please check what the comment suggests, thus,
> && last_and_only_stmt (loop->latch) == cond_stmt
There's no simple way to do such a check,
as the control variable increment stmt is explicitly created in
canonicalize_loop_ivs and not in tree-parloops.
What we do know is that it is put in the latch because we ask for it when
we call canonicalize_loop_ivs from parloops.
One way to get the control variable increment stmt is to use
canonicalize_loop_ivs() return value and look for the stmts that use it.
Do you think I should add all this functionality to the code in order to
the stmt that is in the latch? or can I skip it ?