This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] tree-ssa-sink.c: Don't restrict immediate uses that weconsider.
Hi Daniel,
> > Attached is a patch to teach nearest_common_dominator_of_uses not to
> > restrict the set of immediate uses that we consider.
> >
> > nearest_common_dominator_of_uses goes through immediate uses to find a
> > location to sink a statement into. It's important that we consider
> > all uses so that whatever location we come with dominates all uses.
> > It's dangerous to have an "if" statement to restrict the set of
> > immediate uses that we consider like so
> >
> > if (PHI_ARG_DEF (usestmt, idx) == var)
> >
> > because the location that we come up with may not dominate all uses.
> >
> You were the one who just added thi. :)
:-)
> So doesn't this effectively just undo the patch you had come up with?
No. Before my previous patch, we were going through all the PHI
arguments in a PHI node where a use occurs at least once.
After my previous patch, we only look at a PHI argument which actually
uses an SSA_NAME in question.
With this patch, we still look at a PHI argument which actually uses
an SSA_NAME in question. My new patch just removes a restriction that
a use must be a naked SSA_NAME (although a use of an SSA_NAME in a PHI
argument should always be naked anyway).
I now think this new patch is obvious. Committed as obvious.
Kazu Hirata