This is the mail archive of the gcc@gcc.gnu.org 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?


In message <20020503.172316.55515951.kazu@cs.umass.edu>, Kazu Hirata writes:
 > Hi Toshi,
 > 
 > > For example, GCC generates this code for a right shift by 8 on the
 > > H8/300H:
 > > 
 > >         mov.w   e0,r2
 > >         mov.b   r0h,r0l
 > >         mov.b   r2l,r0h
 > >         mov.b   r2h,r2l
 > >         exts.w  r2
 > >         mov.w   r2,e0
 > 
 > I was thinking about the same thing.  Shifts that require loops are in
 > the same situation.  Also, if you want to use stw.l for argument push
 > on H8/S, you need to know what registers are available, but this might
 > require MACHINE_DEPENDENT_REORG.
 > 
 > > 3. New optimizer pass which runs after global alloc which 
 > >    opportunistically replaces slow sequences with fast sequences if hard
 > >    registers are available.
 > 
 > This sounds very reasonable to me.
Look at how peephole2 works.  It's designed to be able to replace one sequence
with another (possibly faster, smaller, whatever) when hard registers are
available.

jeff



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