summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-02-22 20:55:50 +0000
committerTim Northover <tnorthover@apple.com>2016-02-22 20:55:50 +0000
commitd32f8e60bf819e75f496f060b3f01bb8dc68fc42 (patch)
tree94164c061e87f19f50cd2ae09a0309eb5575a558 /llvm/lib/Transforms
parentc5b668deb8848bca64e71efab5a3477857548e0f (diff)
downloadbcm5719-llvm-d32f8e60bf819e75f496f060b3f01bb8dc68fc42.tar.gz
bcm5719-llvm-d32f8e60bf819e75f496f060b3f01bb8dc68fc42.zip
ARM: sink atomic release barrier as far as possible into cmpxchg.
DMB instructions can be expensive, so it's best to avoid them if possible. In atomicrmw operations there will always be an attempted store so a release barrier is always needed, but in the cmpxchg case we can delay the DMB until we know we'll definitely try to perform a store (and so need release semantics). In the strong cmpxchg case this isn't quite free: we must duplicate the LDREX instructions to skip the barrier on subsequent iterations. The basic outline becomes: ldrex rOld, [rAddr] cmp rOld, rDesired bne Ldone dmb Lloop: strex rRes, rNew, [rAddr] cbz rRes Ldone ldrex rOld, [rAddr] cmp rOld, rDesired beq Lloop Ldone: So we'll skip this version for strong operations in "minsize" functions. llvm-svn: 261568
Diffstat (limited to 'llvm/lib/Transforms')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud