This is the mail archive of the 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]

Another DOM related speedup

DOM internally performs copy propagation as well as a variety of other
optimizations.  While working to reduce our dependence on DOM to do
these things, I noticed we were running a full copy propagation pass
after DOM -- that's rather silly (and will continue to be silly, even
as we reduce our reliance on DOM).

DOM can leave two kinds of copy propagation opportunities in the IL.
The first are those copies which are unsafe or unprofitable to
propagate.  Clearly those shouldn't be mucked with.  The second are
degenerate PHIs exposed/created by jump threading which are left in
the IL if DOM does not iterate.

The copy propagator will examine every PHI node and every statement
in an attempt to identify copies.  Examining every statement to see
if it's a copy-prop opportunity after DOM is a waste of time.  We
just need to examine the PHI nodes.

It turns out that it's trivial to seed the copy-propagation code
differently so that it only examines PHI nodes for copy propagation
opportunities.  By doing this we can still get the benefit of running
a copy propagation pass after DOM, but with less compile-time overhead.

This patch replaces the two calls to the full copy propagator which
occur immediately after DOM with calls to the phi-only copy propagator.
It also adds a call to the phi-only copy propagator after the first
DOM pass.  The net result is a small, but consistent compile-time
improvement (.2% -.3%).

Bootstrapped and regression tested on i686-pc-linux-gnu.

Attachment: PPP
Description: Text document

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