This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Disable old loop optimizer
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 Apr 2005 12:35:42 -0700
- Subject: Re: [patch] Disable old loop optimizer
- Organization: CodeSourcery, LLC
- References: <20050331212322.GA17354@atrey.karlin.mff.cuni.cz> <425C8868.6070403@codesourcery.com> <20050413085733.GA26367@atrey.karlin.mff.cuni.cz>
Zdenek Dvorak wrote:
as far as I know, there are the following optimizations or optimization
enhancements that are only handled by the old loop optimizer:
1) array prefetching: We now have speculative prefetching, which
partially replaces the functionality, but it is a bit cumbersome
to use (needs profile feedback). Also, there are several possible
replacement patches:
I would certainly think that this could -- and should --be done at the
tree level.
2) loop reversal (i.e. replacing "for (i = 0; i < n; i++) a[i]=i;" with
"for (i = n - 1; i >= 0; i--) a[i]=i;", thus causing us to compare with
zero instead of arbitrary bound, and possibly shorten the life range
of n). Should be trivial within linear-transform framework, the major
problem is to decide when it is really useful.
Likewise.
3) ivopts do not handle induction variables with nonconstant step,
whereas the old loop optimizer does (PR 18316, patch
http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00142.html needs
updating).
Likewise.
So, that's good -- the things that are missing seem like things that we
can add at the tree level.
My immediate reaction, however, is that we should add them first, before
removing or disabling the RTL optimizer. Otherwise, the risk is that we
don't get the tree-level work done before GCC 4.1 gets close, and then
we have performance regressions. Meanwhile, the RTL code has not been
receiving testing.
My reason for proposing disabling of the old loop optimizer is that I
would like to get some testing in this situation.
Then I'd suggest we add an option to enable the new code in lieu of the
new, and ask people to test with that option turned on.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304