[PATCH][AArch64] Prefer ldp x, x to ldr q

James Molloy James.Molloy at arm.com
Tue Aug 5 05:39:45 PDT 2014


Hi Arnold,

Thanks! Patch applied with your suggested changes in r214859.

Cheers,

James

-----Original Message-----
From: Arnold Schwaighofer [mailto:aschwaighofer at apple.com]
Sent: 04 August 2014 19:34
To: James Molloy
Cc: Tim Northover; llvm-commits
Subject: Re: [PATCH][AArch64] Prefer ldp x, x to ldr q


> On Aug 4, 2014, at 6:38 AM, James Molloy <James.Molloy at arm.com> wrote:
>
> Hi Tim,
>
> [cc. Arnold as this affects SLP vectorizer rather than just the cost model]
>
> The attached patch attempts to fix this in a non-hacky way.
>
> The intent is to add explicit modelling of the costs involved in keeping values live over a callsite. The patch causes the SLP Vectorizer to scan its generated tree bottom-up, keeping track of all values live. When it encounters a call instruction (that is not part of the tree), it calls out to a new TTI hook.
>
> Most architectures will use the NoAA version of this hook which just returns zero cost, but AArch64 returns the cost of a spill and fill if a 128-bit vector type is used.
>
> This algorithm is conservative and may not catch all cases. For example:
>
> A:
>  X = load ...
>  Goto B
> B:
>  Call ...
>  Goto C
> C:
>  Store X
>
> Because there are no instructions within the SLP tree in block B, it will not see the call instruction. This is a limitation due to the difficulty of finding the "right path" from block C to block A without any helping information. In practice I don't see this as a large limitation - a conservative heuristic is still better than no heuristic (or a badly-modelled heuristic).

I think this is okay. This looks good to me.

Could we use smallptrset and smallvector instead of the stl equivalents. I think our sets are going to be small in many cases.



-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782





More information about the llvm-commits mailing list