This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] copy-propagation pass
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: dnovillo at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Nov 2002 16:14:18 -0500
- Subject: Re: [tree-ssa] copy-propagation pass
On Monday, November 25, 2002, at 01:25 PM, Aldy Hernandez wrote:
Howdy all.
Here is a preliminary patch for copy-propagation on trees.
In talking with Diego, we have found one big problem, which is:
a = y;
y = z;
if (a)
blah;
Under the current infrastructure, we'd propagate a=y on if(a) which is
wrong because Y has been killed after the definition of A.
Which gives you A few simple options:
1.Use a combination of dominator info (if the two refs are in different
BB's) and linear backwards walks (see if you hit a redefinition of y
between the target and the source) to determine if it's safe.
2. Introduce a temporary for just these special cases (IE when you have
a redefinition(.
Kinda defeats the purpose of copy-prop.
3. Don't copy-prop these.