diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-02-20 13:56:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-02-20 13:56:01 +0100 |
commit | b1fb9f569958b2f6127f32495821a5b69c0a2c33 (patch) | |
tree | c37b4e8fdb620aa7e10238c591d1e5c0c5753af2 /gcc/loop-invariant.c | |
parent | da9c199f2cbefd192f9ec89579c7a627fa113bfc (diff) | |
download | gcc-b1fb9f569958b2f6127f32495821a5b69c0a2c33.zip gcc-b1fb9f569958b2f6127f32495821a5b69c0a2c33.tar.gz gcc-b1fb9f569958b2f6127f32495821a5b69c0a2c33.tar.bz2 |
re PR middle-end/39157 (Code that compiles fine in 1GB of memory with 4.1.2 requires > 20GB in 4.2.* and higher)
PR middle-end/39157
* Makefile.in (loop-invariant.o): Depend on $(PARAMS_H).
* params.h (LOOP_INVARIANT_MAX_BBS_IN_LOOP): Define.
* params.def (loop-invariant-max-bbs-in-loop): New parameter.
* opts.c (decode_options): Set loop-invariant-max-bbs-in-loop
parameter to 1000 for -O1 by default.
* doc/invoke.texi (loop-invariant-max-bbs-in-loop): Document new
parameter.
* loop-invariant.c: Include params.h.
(move_loop_invariants): Don't call move_single_loop_invariants on
very large loops.
From-SVN: r144320
Diffstat (limited to 'gcc/loop-invariant.c')
-rw-r--r-- | gcc/loop-invariant.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index 8b8345f..82e1829 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -1,5 +1,6 @@ /* RTL-level loop invariant motion. - Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of GCC. @@ -52,6 +53,7 @@ along with GCC; see the file COPYING3. If not see #include "df.h" #include "hashtab.h" #include "except.h" +#include "params.h" /* The data stored for the loop. */ @@ -1345,7 +1347,10 @@ move_loop_invariants (void) /* Process the loops, innermost first. */ FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST) { - move_single_loop_invariants (loop); + /* move_single_loop_invariants for very large loops + is time consuming and might need a lot of memory. */ + if (loop->num_nodes <= (unsigned) LOOP_INVARIANT_MAX_BBS_IN_LOOP) + move_single_loop_invariants (loop); } FOR_EACH_LOOP (li, loop, 0) |