aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorRobin Morisset <morisset@google.com>2014-10-02 22:27:07 +0000
committerRobin Morisset <morisset@google.com>2014-10-02 22:27:07 +0000
commite1ca44bd4c1dd12106b6e933c8649363a69ac6c6 (patch)
treedcee4fb44acff33fbf84f040f41707cc13e5dd7c /llvm/lib/Object/COFFObjectFile.cpp
parent7425c8c279a78e074831626fe880202dae67f30d (diff)
downloadllvm-e1ca44bd4c1dd12106b6e933c8649363a69ac6c6.zip
llvm-e1ca44bd4c1dd12106b6e933c8649363a69ac6c6.tar.gz
llvm-e1ca44bd4c1dd12106b6e933c8649363a69ac6c6.tar.bz2
[Power] Improve the expansion of atomic loads/stores
Summary: Atomic loads and store of up to the native size (32 bits, or 64 for PPC64) can be lowered to a simple load or store instruction (as the synchronization is already handled by AtomicExpand, and the atomicity is guaranteed thanks to the alignment requirements of atomic accesses). This is exactly what this patch does. Previously, these were implemented by complex load-linked/store-conditional loops.. an obvious performance problem. For example, this patch turns ``` define void @store_i8_unordered(i8* %mem) { store atomic i8 42, i8* %mem unordered, align 1 ret void } ``` from ``` _store_i8_unordered: ; @store_i8_unordered ; BB#0: rlwinm r2, r3, 3, 27, 28 li r4, 42 xori r5, r2, 24 rlwinm r2, r3, 0, 0, 29 li r3, 255 slw r4, r4, r5 slw r3, r3, r5 and r4, r4, r3 LBB4_1: ; =>This Inner Loop Header: Depth=1 lwarx r5, 0, r2 andc r5, r5, r3 or r5, r4, r5 stwcx. r5, 0, r2 bne cr0, LBB4_1 ; BB#2: blr ``` into ``` _store_i8_unordered: ; @store_i8_unordered ; BB#0: li r2, 42 stb r2, 0(r3) blr ``` which looks like a pretty clear win to me. Test Plan: fixed the tests + new test for indexed accesses + make check-all Reviewers: jfb, wschmidt, hfinkel Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5587 llvm-svn: 218922
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions