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: IRA patch: move clobbers downwards

On Tue, Jul 13, 2010 at 12:01 PM, Bernd Schmidt <> wrote:
> On 07/13/2010 11:59 AM, Steven Bosscher wrote:
>> On Tue, Jul 13, 2010 at 11:41 AM, Bernd Schmidt <> wrote:
>>> This is an older patch I'm resubmitting. ?The scheduler can move reg
>>> clobbers away from the insns for which they were generated, generating a
>>> window during which IRA thinks the register is live when it isn't. ?This
>>> can cause unnecessary conflicts.
>>> The real problem here is that IRA does a backwards scan; just as in
>>> peep2, it would probably be better to use a forwards scan using REG_DEAD
>>> notes. ?However, I'm told it's expensive to create those.
>> A backward scan is what practically every compiler (and every text
>> book) except GCC uses, so that can't really be the "real problem".
>> I'd say the real problem is that the clobbers are moved, or generated
>> at all for registers that are not live anyway. Are those clobbers
>> necessary? Can they be removed instead?
> (clobber (reg:DI))
> (set (low half))
> (set (high half))
> is a common pattern in GCC to limit lifetimes of DImode pseudos. ?Maybe
> the text books ignore this problem, it wouldn't be the only one.

Most text books do, but most compilers do not.

Anyway, it seems to me that the scheduler should not move the clobber
up for a case like this, and that this is the real problem. Perhaps
the scheduler can be taught to give clobbers a low-enough priority to
schedule them no earlier than the first instruction that depends on it
(assuming the scheduler creates dependencies of the SETs on the


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