This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] COND_EXPR lowering preview
Hello,
> >> It removes linearization from cfg cleanup, since the half of it
> >> is redundant with the patch and the rest contains several
> >> serious bugs (the most important one being that it uses merge_blocks; this
> >> function contains more bugs than correct code :-(
> >>
> >Test cases? Better yet. Fixes? Generalizations like this one are
> >hardly useful.
> As for cfg cleanup, I'd really like to see some analysis on both the
> bugs
I overestimated quite a bit here. Considering merge_tree_blocks, I was
mislead by its name to thinking that it indeed should be a generic
function to merge blocks, not just a specific subroutine of
linearize_cond_expr. Considering the bugs directly in
linearize_cond_expr, phi nodes handling is missing in removal of if (0)
/ if (1) conditions.
> and with/without. ie, I don't want to start taking steps backwards
> in terms of performance. Simply claiming its unncessary isn't enough.
First part is the linearization of if (0) / if (1) conditions that is done
directly in cleanup_cond_expr_graph with the patch.
The rest is removal of conditional with both branches empty; removing
this is indeed a step back, but I have ready a patch for jump threading
that replaces it (and does not require computing postdominators).
> >> Some possibly useful cleanups were removed from
> >> remove_useless_stmts_and_vars; this function is not suitable for
> >> work over unstructured code.
> >>
> >Again. Please separate this. It has little to do with COND_EXPR
> >lowering.
> Actually remove_useless_stmts_and_vars is supposed to work with unstructured
> code. If it does not, I'd really like to see some analysis why.
Huh? There is no cfg in time you call it, so there is no simple way
to know where branches of the cond_expr lead to, therefore the parts
that check what code is in branches can't work. The rest is elimination
of cond_exprs with zero/nonzero condition + those whose branches jump to
the same place, both of these are done by cfg cleanup anyway.
Zdenek