diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-20 12:56:01 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-20 12:56:01 +0000 |
commit | 86482d6bf55db0eea64cf549bf04c6763f4074a4 (patch) | |
tree | c37b4e8fdb620aa7e10238c591d1e5c0c5753af2 /gcc/loop-invariant.c | |
parent | cd102cfc1332aec577e6ed9cbed3283297ed7ba1 (diff) | |
download | gcc-86482d6bf55db0eea64cf549bf04c6763f4074a4.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144320 138bc75d-0d04-0410-961f-82ee72b054a4
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 8b8345fe5fd..82e18297e20 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) |