From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joern Rennecke To: egcs@cygnus.com Subject: Re: Reload patch to improve 386 code Date: Thu, 21 Aug 1997 16:51:55 -0000 Message-id: <199708211632.RAA01567@phal.cygnus.co.uk> In-reply-to: Pine.SOL.3.90.970821173955.733C-100000@maigret.informatik.rwth-aachen.de X-SW-Source: 1997-08/0250.html > > The problem with this is that you might have additional spills if you > > remove reload inherits - when you inherit a reload that needs a secondary > > reload, you extend the lifetime of only one reload register, instead of needing > > two (or more, when a tertiary reload would be needed too.) > > Are you sure? The inheritance code in choose_reload_regs is run after all > spilling has been done, so I don't think removing it could cause additional > spills. You are right, I mixed up something here. What I actually saw was when an inherit was missed, the new reload - or its secondary reloads - would clobber other reload registers, which could otherwise have been used for subsequent inherits. reload_cse coudn't clean up the mess - it just changed the reload for the missed inherit from a memory-register to a register-register move. It isn't clever enough to reassign reload registers and then reclaim the freed register for further cse. > The reason I'm not happy with the inheritance code is that find_equiv_reg > is overly conservative; e.g. it misses cases like this: > > movl %eax,16(%esp) > movl %eax,some_symbol > addl 16(%esp),%ebx > > where the addl could inherit the value in %eax. My idea is to teach I think my inheritance patches would fix that too.