This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/41026] invariant address load inside loop with -Os.
- From: "rahul at icerasemi dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2009 15:46:34 -0000
- Subject: [Bug tree-optimization/41026] invariant address load inside loop with -Os.
- References: <bug-41026-17160@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rahul at icerasemi dot com 2009-08-13 15:46 -------
Confirmed. Introducing loop header copy for Os, resolves the problem.
On our port, this not only helps move the invariant load outside the loop, but
also correctly uses an auto-increment address mode via the AutoInc patches we
use. Other examples also confirm that the header copying enables more induction
variables to be identified and hence post-increment opportunities.
Does better loop analysis and hence potential for further optimizations
outweigh the cost of copying the loop header? It would be ideal to relax the
loop header copy predicate for Os and select an appropriate threshold,
currently set at 20 insn, a lower value to start with perhaps.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41026