This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]