Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Issue 362463002: Subzero: lower the rest of the atomic operations. (Closed)

Created:
6 years, 5 months ago by jvoung (off chromium)
Modified:
6 years, 5 months ago
Reviewers:
Jim Stichnoth, JF
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Subzero: lower the rest of the atomic operations. 64-bit ops are expanded via a cmpxchg8b loop. 64/32-bit and/or/xor are also expanded into a cmpxchg / cmpxchg8b loop. Add a cross test for atomic RMW operations and compare and swap. Misc: Test that atomic.is.lock.free can be optimized out if result is ignored. TODO: * optimize compare and swap with compare+branch further down instruction stream. * optimize atomic RMW when the return value is ignored (adds a locked field to binary ops though). * We may want to do some actual target-dependent basic block splitting + expansion (the instructions inserted by the expansion must reference the pre-colored registers, etc.). Otherwise, we are currently getting by with modeling the extended liveness of the variables used in the loops using fake uses. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3882 R=jfb@chromium.org, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=a3a01a2

Patch Set 1 #

Patch Set 2 : sketch of cross test #

Patch Set 3 : fill out xchg also #

Patch Set 4 : add crosstest flag #

Patch Set 5 : cross test now works #

Patch Set 6 : fix esp/ebp #

Patch Set 7 : extend live range to model the loop... #

Patch Set 8 : beef up the crosstest a bit #

Patch Set 9 : rename files #

Patch Set 10 : Add an actually threaded test #

Patch Set 11 : comment cleanup #

Total comments: 39

Patch Set 12 : first review-ish #

Patch Set 13 : test a 64-bit #

Patch Set 14 : rebase #

Patch Set 15 : extend live range for xchg too #

Patch Set 16 : revert register alloc workarounds #

Total comments: 12

Patch Set 17 : jf review #

Patch Set 18 : var name style #

Patch Set 19 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1556 lines, -166 lines) Patch
M crosstest/crosstest.py View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -2 lines 0 comments Download
M crosstest/runtests.sh View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +12 lines, -0 lines 0 comments Download
A crosstest/test_sync_atomic.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +29 lines, -0 lines 0 comments Download
A crosstest/test_sync_atomic.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +63 lines, -0 lines 0 comments Download
A crosstest/test_sync_atomic.def View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +50 lines, -0 lines 0 comments Download
A crosstest/test_sync_atomic_main.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +298 lines, -0 lines 0 comments Download
M src/IceInstX8632.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 chunks +139 lines, -6 lines 0 comments Download
M src/IceInstX8632.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +98 lines, -9 lines 0 comments Download
M src/IceIntrinsics.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/IceTargetLoweringX8632.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +33 lines, -1 line 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +197 lines, -18 lines 0 comments Download
M tests_lit/llvm2ice_tests/nacl-atomic-intrinsics.ll View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +627 lines, -129 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
jvoung (off chromium)
https://codereview.chromium.org/362463002/diff/350013/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/362463002/diff/350013/src/IceTargetLoweringX8632.cpp#newcode2719 src/IceTargetLoweringX8632.cpp:2719: if (hasFramePointer()) split out -- but currently here so ...
6 years, 5 months ago (2014-07-07 17:31:16 UTC) #1
Jim Stichnoth
https://codereview.chromium.org/362463002/diff/350013/crosstest/test_sync_atomic.cpp File crosstest/test_sync_atomic.cpp (right): https://codereview.chromium.org/362463002/diff/350013/crosstest/test_sync_atomic.cpp#newcode13 crosstest/test_sync_atomic.cpp:13: if (fetch_first) return __sync_fetch_and_##inst(ptr, a); \ Violation (here and ...
6 years, 5 months ago (2014-07-08 04:50:20 UTC) #2
jvoung (off chromium)
Thanks Jim, a couple of replies first before I address the rest of the comments. ...
6 years, 5 months ago (2014-07-08 18:14:07 UTC) #3
jvoung (off chromium)
https://codereview.chromium.org/362463002/diff/350013/src/IceInstX8632.h File src/IceInstX8632.h (right): https://codereview.chromium.org/362463002/diff/350013/src/IceInstX8632.h#newcode332 src/IceInstX8632.h:332: static InstX8632Unaryop *create(Cfg *Func, Variable *SrcDest) { On 2014/07/08 ...
6 years, 5 months ago (2014-07-09 17:07:56 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/362463002/diff/350013/src/IceInstX8632.h File src/IceInstX8632.h (right): https://codereview.chromium.org/362463002/diff/350013/src/IceInstX8632.h#newcode332 src/IceInstX8632.h:332: static InstX8632Unaryop *create(Cfg *Func, Variable *SrcDest) { On 2014/07/09 ...
6 years, 5 months ago (2014-07-09 18:14:28 UTC) #5
Jim Stichnoth
So, this LGTM assuming JF is good with it. For the record, the register allocation ...
6 years, 5 months ago (2014-07-09 22:59:59 UTC) #6
jvoung (off chromium)
With https://code.google.com/p/nativeclient/issues/detail?id=3897 fixed (thanks!), I removed the register allocation workarounds. https://codereview.chromium.org/362463002/diff/350013/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/362463002/diff/350013/src/IceTargetLoweringX8632.cpp#newcode2169 ...
6 years, 5 months ago (2014-07-10 23:14:50 UTC) #7
JF
I didn't check the lit tests, I assume Jim validated them :-) The rest lgtm ...
6 years, 5 months ago (2014-07-13 19:56:12 UTC) #8
jvoung (off chromium)
Thanks! https://codereview.chromium.org/362463002/diff/490001/crosstest/test_sync_atomic.h File crosstest/test_sync_atomic.h (right): https://codereview.chromium.org/362463002/diff/490001/crosstest/test_sync_atomic.h#newcode1 crosstest/test_sync_atomic.h:1: #include "test_sync_atomic.def" On 2014/07/13 19:56:12, JF wrote: > ...
6 years, 5 months ago (2014-07-14 16:20:31 UTC) #9
jvoung (off chromium)
6 years, 5 months ago (2014-07-14 17:32:47 UTC) #10
Message was sent while issue was closed.
Committed patchset #19 manually as ra3a01a2 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698