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: IRA conflict graph & alternative selection


Jeff Law <law@redhat.com> writes:

>> No, that makes no sense.  What I'm suggesting is that we fix the stack
>> offsets of all local variables before register allocation, based on a
>> conservative assessment of how many registers will be saved on the
>> stack.  Then we know during register allocation whether the memory
>> reference will be in or out of the +- 16 byte range. 
> Just fixing the offset is not sufficient for the case I'm concerned
> about because you don't know what offsets are valid until you know
> precisely what registers are used in the insn.   That's absolutely
> critical.  So you have to assume worst case which is you can only use
> the +-16 byte insns which will pessimize just about every stack
> reference.

You fix the offset of the value stored on the stack.  Given that, you
know which instruction you can use.

> Perhaps the confusion in this case is because we're not really
> relaxing -- we're dealing with a case where the offset alone isn't
> enough to determine if the addressing mode is valid.

The confusion may be that we may be talking about different things.
I'm talking about removing this loop in the reload function:

  /* This loop scans the entire function each go-round
     and repeats until one repetition spills no additional hard regs.  */


>>> Without knowing the size of the frame, how do you plan on doing this
>>> without making the assumption that nothing is going to fit in the
>>> shorter displacement variants?  How can you do this when the range of
>>> valid displacements can change because the register you used got
>>> spilled and you got a register from a different class (which in turn
>>> has a drastically smaller set of valid displacements).
>>>     
>>
>> I'm saying that you guess the size of the frame, so your premise does
>> not describe the aproach that I am suggesting.
>>   
> But the offsets are relative to the size of the frame.  So I don't see
> how you can set the offsets without knowing the size of the frame.

You know the size of the frame, by guessing conservatively as to how
many registers will be required.

Ian


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