pro64-support
[Top] [All Lists]

RE: unoptimized dead store

To: "'Stuart Hastings'" <stuart@xxxxxxxxx>
Subject: RE: unoptimized dead store
From: "Chan, Sun C" <sun.c.chan@xxxxxxxxx>
Date: Thu, 10 May 2001 10:14:18 -0700
Cc: "'Robert Kennedy'" <robert@xxxxxxxxxxxxx>, shinmingliu@xxxxxxxxx, pro64-support@xxxxxxxxxxx
Sender: owner-pro64-support@xxxxxxxxxxx

> -----Original Message-----
> From: Stuart Hastings [mailto:stuart@xxxxxxxxx]
> Sent: Thursday, May 10, 2001 9:32 AM
> To: Chan, Sun C
> Cc: Stuart Hastings; 'Robert Kennedy'; shinmingliu@xxxxxxxxx;
> pro64-support@xxxxxxxxxxx
> Subject: Re: unoptimized dead store
> 
> 
> 
> On Wednesday, May 9, 2001, at 04:05  PM, Chan, Sun C wrote:
> 
> > The other possibility is that since "a" is global, it could 
> be modified
> > by a shared library. If you mark "a" as static, the 
> statement should go
> > away. If not, it is back to your conjecture.
> > BTW, thx for pointing out the obvious.
> > Sun
> 
> O.K., if 'a' is declared static, then it is immune from 
> tampering by a 
> shared library. However, I was hoping that IPA would be able to tell 
> that neither glarp() nor any of its callees reference 
> variable 'a'. If a 
> shared library was going to reference 'a', then glarp() or one of its 
> callees would be invoking an external function somewhere; they don't, 
> and IPA should know that.

You're right, I looked at the test case more carefully and I retract my
claim that "a" needs to be static.
Even with shared library, "a" can be derived to be dead.
This is what needs to happen:
mod/ref info from call site glarp should return "a" not ref'd.
Alias (mu/chi) building in Wopt should not have "a" on the list.
Now 2 can be copy propagated into expression a+b and become 3+b.
Both a=2 and a++ is now dead.
What is not implemented in Wopt is Mu/Chi building not incorporating
mod/ref info from IPA. This is a long standing item on the todo list.
Any takers? 
Incidentally, this topic is also covered in a paper in the up coming PLDI.

Sun

 


<Prev in Thread] Current Thread [Next in Thread>