5 years, 11 months ago
(2015-01-07 01:12:38 UTC)
#1
JF
I'm not super satisfied with the testing yet, but I think that the bulk of ...
5 years, 11 months ago
(2015-01-07 01:13:40 UTC)
#2
I'm not super satisfied with the testing yet, but I think that the bulk of the
code review can start and I'll update the patch with better testing.
Jim Stichnoth
Will you be adding tests of architecture-specific lowering for these new options? https://codereview.chromium.org/791053006/diff/1/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp File lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp ...
5 years, 11 months ago
(2015-01-07 21:21:01 UTC)
#3
> Will you be adding tests of architecture-specific lowering for > these new options? I ...
5 years, 11 months ago
(2015-01-07 21:33:57 UTC)
#4
> Will you be adding tests of architecture-specific lowering for
> these new options?
I wasn't intending to add LLVM-side tests: these instructions are supported by
LLVM and tested the same way load/store/add/multiply are tested. I do have tests
on the NaCl side for things like GCC's __sync_* builtins, so these should batch
some bad behavior.
The tests I still want to add are for cmpxchg's complexities.
https://codereview.chromium.org/791053006/diff/1/lib/Analysis/NaCl/PNaClABIVe...
File lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp (right):
https://codereview.chromium.org/791053006/diff/1/lib/Analysis/NaCl/PNaClABIVe...
lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp:171: llvm_unreachable("Invalid
memory order");
On 2015/01/07 21:21:01, stichnot wrote:
> Should these llvm_unreachable calls be stronger, i.e. report_fatal_error ?
This should truly be unreachable given the code above:
I.ule(NaCl::MemoryOrderInvalid) || I.uge(NaCl::MemoryOrderNum)
I'd use report_fatal_error in cases that aren't obviously unreachable.
https://codereview.chromium.org/791053006/diff/1/test/Transforms/NaCl/atomic/...
File test/Transforms/NaCl/atomic/atomic_others.ll (left):
https://codereview.chromium.org/791053006/diff/1/test/Transforms/NaCl/atomic/...
test/Transforms/NaCl/atomic/atomic_others.ll:5: ; value 6). This will change
once we support other memory orderings.
On 2015/01/07 21:21:01, stichnot wrote:
> Should there be a "this may change..." comment left in, or is this pretty much
> the final set of consistency options we are going to support?
I'm not sure when/how it'll change: consume will likely be renamed to something
else (in which case it's a new memory ordering) and the verdict is still out on
relaxed. I'd rather not explain the subtleties here.
This CL's change was exactly as intended when the comment was written, but the
future changes are pretty unknown.
Jim Stichnoth
On 2015/01/07 21:33:57, JF wrote: > > Will you be adding tests of architecture-specific lowering ...
5 years, 11 months ago
(2015-01-07 23:26:59 UTC)
#5
On 2015/01/07 21:33:57, JF wrote:
> > Will you be adding tests of architecture-specific lowering for
> > these new options?
>
> I wasn't intending to add LLVM-side tests: these instructions are supported by
> LLVM and tested the same way load/store/add/multiply are tested. I do have
tests
> on the NaCl side for things like GCC's __sync_* builtins, so these should
batch
> some bad behavior.
>
>
> The tests I still want to add are for cmpxchg's complexities.
>
>
https://codereview.chromium.org/791053006/diff/1/lib/Analysis/NaCl/PNaClABIVe...
> File lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp (right):
>
>
https://codereview.chromium.org/791053006/diff/1/lib/Analysis/NaCl/PNaClABIVe...
> lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp:171: llvm_unreachable("Invalid
> memory order");
> On 2015/01/07 21:21:01, stichnot wrote:
> > Should these llvm_unreachable calls be stronger, i.e. report_fatal_error ?
>
> This should truly be unreachable given the code above:
> I.ule(NaCl::MemoryOrderInvalid) || I.uge(NaCl::MemoryOrderNum)
>
> I'd use report_fatal_error in cases that aren't obviously unreachable.
>
>
https://codereview.chromium.org/791053006/diff/1/test/Transforms/NaCl/atomic/...
> File test/Transforms/NaCl/atomic/atomic_others.ll (left):
>
>
https://codereview.chromium.org/791053006/diff/1/test/Transforms/NaCl/atomic/...
> test/Transforms/NaCl/atomic/atomic_others.ll:5: ; value 6). This will change
> once we support other memory orderings.
> On 2015/01/07 21:21:01, stichnot wrote:
> > Should there be a "this may change..." comment left in, or is this pretty
much
> > the final set of consistency options we are going to support?
>
> I'm not sure when/how it'll change: consume will likely be renamed to
something
> else (in which case it's a new memory ordering) and the verdict is still out
on
> relaxed. I'd rather not explain the subtleties here.
>
> This CL's change was exactly as intended when the comment was written, but the
> future changes are pretty unknown.
That all sounds good. I guess I'll wait to see the cmpxchg tests.
JF
> That all sounds good. I guess I'll wait to see the cmpxchg tests. I ...
5 years, 11 months ago
(2015-01-08 00:25:09 UTC)
#6
> That all sounds good. I guess I'll wait to see the cmpxchg tests.
I added some tests. The abi-atomics.ll test finds a bug that I need to fix. I
also want to test the other atomic functions in that file.
JF
On 2015/01/08 00:25:09, JF wrote: > > That all sounds good. I guess I'll wait ...
5 years, 11 months ago
(2015-01-08 01:08:24 UTC)
#7
On 2015/01/08 00:25:09, JF wrote:
> > That all sounds good. I guess I'll wait to see the cmpxchg tests.
>
> I added some tests. The abi-atomics.ll test finds a bug that I need to fix. I
> also want to test the other atomic functions in that file.
Bugs are now stomped.
Tree is currently closed. Will commit when it's open. https://codereview.chromium.org/791053006/diff/180001/test/NaCl/PNaClABI/abi-atomics.ll File test/NaCl/PNaClABI/abi-atomics.ll (right): https://codereview.chromium.org/791053006/diff/180001/test/NaCl/PNaClABI/abi-atomics.ll#newcode3 test/NaCl/PNaClABI/abi-atomics.ll:3: ...
5 years, 11 months ago
(2015-01-08 19:36:25 UTC)
#9
Issue 791053006: Add support for acquire, release, and acq_rel memory ordering in PNaCl
(Closed)
Created 5 years, 11 months ago by JF
Modified 5 years, 11 months ago
Reviewers: Jim Stichnoth
Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Comments: 8