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

[patch PR middle-end/39326 - compile time and memory explosion in combine


Hello,

The attached patch fixes one of the (at least) three scalability
problems reported in PR middle-end/39326. This problem is that combine
takes forever and increases the memory footprint from ~650MB to >7GB.
The cause is DSE creating a lot of new registers in replace_read, and
those registers are not copy-prop'd out between dse1 and combine. The
result is many overlapping live ranges and single-set-single-use
registers that combine is made to work on.

The fix is to just not create so many new registers in DSE in the
first place. It is wasteful and unnecessary if an existing register
can be re-used.

With this patch, for the test case of the PR the combine time in
combine goes down from ~350s to ~4.5s, and the memory footprint
explosion is avoided. For my set of cc1-i files this also helps reduce
compile time a modest amount, especially for the larger files of
course.

Bootstrapped&tested on {x86_64,powerpc64}-unknown-linux-gnu.
OK for trunk?

Ciao!
Steven


        PR middle-end/39326
        * dse.c (replace_read): If the stored value is a pseudo-register
        that is set only once, re-use it to replace the load instead of
        creating a new register.

Attachment: PR39326_RTLDSE.diff
Description: Binary data


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