Mainline space problem
Geert Bosch
bosch@gnat.com
Wed Sep 1 19:36:00 GMT 2004
On Aug 31, 2004, at 15:55, James E Wilson wrote:
> The underlying problem here, as I have said twice already, is that we
> have too many pseudo regs. Gcc-3.4 needs only about 9K pseudos.
> Mainline needs about 129K pseudos. That leads to about a 200 times
> increase in the memory usage needed, because of the quadratic factor.
A good way of preventing such quadratic behavior, is to divide the
problem into smaller parts and handle them separately. For example,
split a very large function into parts that are processed individually
and insert the necessary code to connect the parts together.
If the problem is very large, chances are the overhead introduced by
the split is small in comparison to the total cost of the function.
Also, forcing such a split shortens live ranges and potentially
allows for more space reuse, further reducing the overhead of
the split.
Currently, the optimizers try to smash an entire function, including
all code that may have been inlined, into a flat piece of code without
scopes. Combined with SSA and tree-level optimizations that work on
entire
functions and generally may extend live ranges of variables, this may
explain why we need so many pseudos in the first place.
-Geert
More information about the Gcc
mailing list