[PATCH 2/3] [PBQP] Callee saved regs should have a higher cost than scratch regs

Lang Hames lhames at gmail.com
Tue Nov 4 10:37:03 PST 2014


LGTM. Please go ahead and commit. Thanks Arnaud!

- Lang.


On Wed, Oct 22, 2014 at 6:38 AM, Arnaud A. de Grandmaison <
arnaud.degrandmaison at arm.com> wrote:

> Hi Lang,
>
>
>
> Could you please review this second patch in the PBQP improvement series ?
>
>
>
> This patch teaches PBQP to handle callee saved registers: registers are
> not all equal.
>
> Some are not allocatable (infinite cost), some have to be preserved but
> can be used,
>
> and some others are just free to use.
>
>
>
> Ensure there is a cost hierarchy reflecting this, so that the allocator
> will favour scratch
>
> registers over callee-saved registers. This does not model fully the
> reality as the cost
>
> for saving / restoring those CSR is paid only once, at their very first
> use, and they then
>
> become equivalent to scratch registers: with this patch, they will always
> have a higher cost.
>
>
>
> One way to improve this would be to handle that on a per allocation round
> basis: if a CSR has
>
> been used in one of the preceding rounds, then it becomes a scratch reg in
> the sense that
>
> it is as cheap to use as a scratch reg. This would be closer to reality.
> What do you think ?
>
>
>
> Cheers,
>
> --
>
> Arnaud A. de Grandmaison
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141104/88f0cf97/attachment.html>


More information about the llvm-commits mailing list