[llvm-bugs] [Bug 35094] New: [AArch64] atomicrmw on Armv8.1-a can change memory ordering
llvm-bugs at lists.llvm.org
Thu Oct 26 03:34:52 PDT 2017
Bug ID: 35094
Summary: [AArch64] atomicrmw on Armv8.1-a can change memory
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: Christof.Douma at arm.com
CC: llvm-bugs at lists.llvm.org
Created attachment 19346
The LD<OP>[A|L|AL] instructions in Armv8.1-a have different memory orderings if
the target register is the zero register (WZR or XZR). In particular they are
no longer loads if the target register is the zero register. This means that
a load barrier ("fence acquire" in LLVM terms) will no longer order these
before the barrier.
These instructions are used for atomicrmw LLVM operations, and LLVM's "AArch64
Dead register definitions" pass tries to use the zero register. If it does, it
changes the semantics (memory order) of the program.
I don't have a real-life example. But I hope the attached example makes the
story a bit clearer.
 Arm ARM for Armv8-A [ARM DDI 0487B.b] section C3.2.13
"The ST<OP> instructions, and LD<OP> instructions where the destination
register is WZR or XZR, are not regarded as doing a read for the purpose of a
DMB LD barrier."
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs