This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question re: SSA Aggressive Dead Code Elimination
On Wed, 27 Jun 2001, Jeff Law wrote:
> > Why? SSA analysis should not munge the program. Convert to SSA
> > and then let PRE and/or partial DCE do their magic. Or did you
> > mean that?
> Because it's bloody trivial and makes the rest of the ssa optimizers do
> less work. Think of it like the difference between local vs global cse.
>
> I strongly recommend you review the section on dominator optimizations in
> Morgan's book. You'll find that these optimizations are so trivial to
> implement during the SSA conversion that it's totally silly not to do so.
>
I didn't read you right, sorry. I read it as if you meant doing
all these transformations *while* computing where phi terms go and
what not. Pre/post processing is what I had in mind.
> > Yes. The error was removing a computation that was only
> > partially redundant.
> No, the computation was totally redundant because we use the value computed
> in a dominator block and copy prop the result to its uses.
>
Ah, yes. I missed the copy propagation. Damn RTL :)
When you re-wrote the phi term, you took away the information of
where the original definitions came from. This prompted DCE to
linearize the path. Shouldn't we keep that information in the
phi term, then?
Diego.