This is the mail archive of the
mailing list for the GCC project.
Re: Post-register-allocation opportunitistic optimizer?
- From: tm <tm at mail dot kloo dot net>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, kazu at cs dot umass dot edu, joern dot rennecke at superh dot com
- Date: Fri, 3 May 2002 14:42:02 -0700 (PDT)
- Subject: Re: Post-register-allocation opportunitistic optimizer?
On Fri, 3 May 2002, Richard Henderson wrote:
> On Fri, May 03, 2002 at 01:12:47PM -0700, tm wrote:
> > 3. New optimizer pass which runs after global alloc which
> > opportunistically replaces slow sequences with fast sequences if hard
> > registers are available.
> See -frename-registers and/or the documentation for define_peephole2.
define_peephole2 comes close, but doesn't quite solve the problem.
Consider a basic block contains multiple opportunistically optimizable
sequences, and two free hard registers.
If I understand correctly, define_peephole2 will optimize the first two
sequences (assuming they both use one hard reg apiece) and fail to
optimize the rest of the cases.
Ideally, the optimizer would sort the opportunities by benefit and only
perform the best N optimizations rather than simply optimize the first N
Could peephole2 be modified to accomodate this, or is it better
implemented as a separate pass?