[PATCH] Improve the cost evaluation of LSR

Wei Mi wmi at google.com
Fri May 1 16:27:39 PDT 2015


>>> *How do we move?
>>>
>>> I would suggest we add an internal option to make LSR more aggressive
>>> w.r.t. to register pressure, and fix all the problems that rise in the
>>> backends. Then, we can turn that option on by default.
>>
>>
>> We want to generate optimal code sequence with minimal cost --- that is not
>> equivalent to 'the most aggressive LSR'.   Do we already know possible ways
>> to fix the problem once the damage is already made (high reg pressure …)?
>>
>>
>> That is the point, we do not know and to me that would be the first
>> information we should seek to determine the best direction. My guts say we
>> may not be able to recover and indeed a register pressure estimation would
>> come handy, but I like facts :).
>>
>
> Wei, is it possible to introduce mode (under the option) that also
> does what Quentin suggested? I like facts and data too.

Yes, I can add various modes for testing under an option like
* the most aggressive LSR supposing we have unlimited registers available.
* the most conservative strategy supposing every register used will
increase a spill. It corresponds to the existing implementation.
* the moderate strategy supposing there are limited registers, and use
reg pressure estimation to evaluate spills.
That will be interesting to see the differences of various modes.

Wei.




More information about the llvm-commits mailing list