[llvm] r310534 - ARM: Fix CMP_SWAP expansion

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 10:13:50 PDT 2017


On Wed, Aug 9, 2017 at 3:22 PM, Matthias Braun via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: matze
> Date: Wed Aug  9 15:22:05 2017
> New Revision: 310534
>
> URL: http://llvm.org/viewvc/llvm-project?rev=310534&view=rev
> Log:
> ARM: Fix CMP_SWAP expansion
>
> Clean up after my misguided attempt in r304267 to "fix" CMP_SWAP
> returning an uninitialized status value.
>
> - I was always using tMOVi8 to zero the status register which cannot
>   encode higher register numbers and llvm would silently miscompile)
>
> - Nobody was ever looking at that status value outside the expansion.
>   ARMDAGToDAGISel::SelectCMP_SWAP() the only place creating CMP_SWAP
>   instructions was not mapping anything to it. (The cmpxchg status value
>   from llvm IR is lowered to a manual comparison after the CMP_SWAP)
>
> So this:
> - Renames the register from "status" to "temp" it make it obvious that
>   it isn't used outside the expansion.
> - Remove the zeroing status/temp register.
> - Keep the live-in list improvements from r304267
>
> Fixes http://llvm.org/PR34056

Merged to 5.0 in r310628.


More information about the llvm-commits mailing list