This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] copy-propagation pass
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, "" <dnovillo at redhat dot com>,"" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Nov 2002 21:35:30 -0500 (EST)
- Subject: Re: [tree-ssa] copy-propagation pass
- References: <20021125182513.GA15095@redhat.com> <firstname.lastname@example.org>
On Mon, 25 Nov 2002, Jason Merrill wrote:
> On Mon, 25 Nov 2002 10:25:13 -0800, Aldy Hernandez <email@example.com> wrote:
> > In talking with Diego, we have found one big problem, which is:
> > a = y;
> > y = z;
> > if (a)
> > blah;
> Seems like SSA should handle this.
It does, technically.
It's just that since var's are canonical, and we don't do actual renaming,
you have no way to say *which* y you want.
Renaming involves adding temporaries (since you are splitting the
single variable name into multiple variable names).
It's just not done *for you* in fud chaining.
Aldy can simply add the temporaries necessary to propagate if he likes (ie
transform it to:
temp = y;
a = y;
y = z;
DCE will then remove whatever isn't actually used anymore (IE if nothing
else uses the value of a).
Just be careful not to re-propagate the temps you add.
> a = y1
> y2 = z;
> if (a) --> if (y1)
> Your problem comes from treating the two y's as one.
It's one of the few optimizations that is a bit trickier without renaming.