This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/34503] Issues with constant/copy propagation implementation in gcse.c



------- Comment #3 from steven at gcc dot gnu dot org  2007-12-17 08:30 -------
The global pass uses inefficient local dataflow properties.  Because there is a
local cprop pass before the global one, some constants/copies do not have to be
recorded.  This results in a smaller set of expressions to compute AVAIL for. 
Some experiments I did, showed that the set can be reduced by more than an
order of magnitude for large functions (for example try the idea on
c-common.c).

A register R in defined a load-immediate instruction (i.e. R<-const) in basic
block B should not be recorded if the register is not in LIVE_OUT(B)After local
cprop, the constant is propagated as far as possible within B, and the
definition of R does not reach any uses outside B.  Thus, not recording the
register value cannot result in missed optimizations.

Likewise, if R1 is defined in a copy instruction R1<-R2 in basic block B, and
R1 is not in LIVE_OUT(B), and R2 is also not in LIVE_OUT(B), then recording the
copy cannot result in missed optimizations, because R2 will have been
propagated locally as far as possible already.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34503


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]