Skip to content

Incorrect barriers for legacy __sync_* on ARM64 #29472

@alexrp

Description

@alexrp
Bugzilla Link 29102
Version trunk
OS All
CC @asl,@zygoloid,@TNorthover

Extended Description

Hi,

r179005 was committed to LLVM in April, 2013. This commit removed several memory barriers around atomic operations on ARM64. The mailing list post [0] regarding the commit cites the Linux kernel as a source for this being a valid change. However, in February 2014, the Linux kernel's atomic operations were patched to contain full barriers [1]. GCC was also fixed sometime before 5.3.0 to emit full barriers. Finally, in the Mono project, we emitted the same code in our JIT's atomic intrinsics as LLVM currently does and found that it indeed suffered from the problem described in [1]. After fixing our JIT to emit the same code that the Linux kernel and GCC use, everything worked fine.

Based on all of the above, I'm inclined to think that r179005 is wrong.

[0] http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20130408/170666.html
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-February/229588.html

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions