Redundant Load Elimination in GCSE

Jan Hubicka jh@suse.cz
Wed Jun 4 21:36:00 GMT 2003


> Deleting "obviously dead" insns:
> 
> Recent changes that we're working on in gcse.c to improve PRE (see
> "GCSE/PRE problem"
> and "Redundant Load Elimination in GCSE")
> have created redundant register-copy instructions (i.e.: an r211 = r232 rtx
> followed
> by another r211 = r232 rtx). These obviously dead copy instructions are not
> cleared
> by cse.c/delete_trivially_dead_insns() because it takes a minimal amount of
> flow
> information to see that the first is dead. So they remain, and create havoc
> to the
> loop unroller because it throws loop.c/basic_induction_var() off track. The
> latter
> is "smart" enough to catch the following (which delete_trivially_dead_insns
> handles):
> 
>      /* If this sets a register to itself, we would repeat any previous
>         biv increment if we applied this strategy blindly.  */
>      if (rtx_equal_p (dest_reg, x))
>        return 0;
> 
> but will repeat any previous biv increment if a pair of identical
> register-copy is
> encountered.
> 
> 
> Adding the following ("delete_obviously_dead_insns") at the end of
> cse.c/delete_trivially_dead_insns() is one way to fix/work around this
> problem:

Perhaps you can use information available in the copy propagation pass
to prove that copy operation is noop.  I believe I even wrote this once
(code to discover noops via cselib)

Honza



More information about the Gcc mailing list