[Thumb] Don't materialize a new base register when CPSR is live

Renato Golin renato.golin at linaro.org
Fri Sep 12 15:15:32 PDT 2014


Hi Moritz,

Why do you need to use ADDS there? Wouldn't that problem be gone if
you used a simple ADD?

Also, this comparison is redundant:

+    if (isThumb1 && !SafeToClobberCPSR)
+      return false;

could be just

+    if (!SafeToClobberCPSR)
+      return false;

though, keeping the comment is probably good.

I suppose reducing the case where you found it proved harder than usual?

cheers,
--renato

On 12 September 2014 17:44, Moritz Roth <Moritz.Roth at arm.com> wrote:
> Hi Renato,
>
>
>
> This patch is a small bugfix for the load/store optimizer. If the CPSR is
> live, we can’t safely materialize a base register + offset in Thumb-1.
>
> There is no test case because I haven’t actually seen this cause problems in
> real code – but theoretically, it’s possible to get spill code inserted
> between e.g. a CMP + Bcc, which would then be a candidate for merging.
>
>
>
> OK to commit?
>
>
>
> Cheers
>
> Moritz
>
>
> -- 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