[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-14 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF requested changes to this revision. EricWF added a comment. This revision now requires changes to proceed. Almost LGTM. Just a couple of inline comments left. Thanks for working on this! Comment at: libcxx/include/memory:3691 + && __has_builtin(__at

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-16 Thread Kevin Hu via Phabricator via cfe-commits
hxy9243 updated this revision to Diff 84565. hxy9243 added a comment. Addresses comments from @EricWF. Thanks for reviewing, I know it takes a lot of energy. It helped me learn a lot. Repository: rL LLVM https://reviews.llvm.org/D24991 Files: libcxx/include/memory libcxx/src/memory.cpp

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-16 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added inline comments. Comment at: libcxx/include/memory:3700 + +template +inline T `template `, please. Otherwise when some client code does `#define T true` (yes, I've seen that!) this breaks. `_Tp` is a reserved identifier, and if they use that

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-16 Thread Kevin Hu via Phabricator via cfe-commits
hxy9243 updated this revision to Diff 84569. hxy9243 added a comment. Addresses comments from @mclow.lists. Repository: rL LLVM https://reviews.llvm.org/D24991 Files: libcxx/include/memory libcxx/src/memory.cpp Index: libcxx/src/memory.cpp ===

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-16 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF accepted this revision. EricWF added a comment. This revision is now accepted and ready to land. LGTM. Repository: rL LLVM https://reviews.llvm.org/D24991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-16 Thread Kevin Hu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292184: [Test patch] Inline hot functions in libcxx shared_ptr (authored by hxy9243). Changed prior to commit: https://reviews.llvm.org/D24991?vs=84569&id=84622#toc Repository: rL LLVM https://revie

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-12-30 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF requested changes to this revision. EricWF added a reviewer: EricWF. EricWF added a comment. This revision now requires changes to proceed. Added a bunch of inline comments. The biggest requested change is removing the `__atomic_support` header. We only need one atomic call within the hea

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-03 Thread Kevin Hu via Phabricator via cfe-commits
hxy9243 set the repository for this revision to rL LLVM. hxy9243 updated this revision to Diff 82958. hxy9243 added a comment. Move the header back in its place, and only copy over necessary parts. Now call __atomic_add_fetch from inside the functions. Repository: rL LLVM https://reviews.llv

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-03 Thread Kevin Hu via Phabricator via cfe-commits
hxy9243 updated this revision to Diff 82962. hxy9243 marked 4 inline comments as done. hxy9243 added a comment. Minor fix, remove redundant inlines. Repository: rL LLVM https://reviews.llvm.org/D24991 Files: libcxx/include/memory libcxx/src/memory.cpp Index: libcxx/src/memory.cpp ==

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-10 Thread Kevin Hu via Phabricator via cfe-commits
hxy9243 marked an inline comment as done. hxy9243 added a comment. Addressed previous issues in the comments. The patch still shows consistent perf uplift in proprietary benchmark on shared_ptr. @EricWF @sebpop @hiraditya Any thoughts? Repository: rL LLVM https://reviews.llvm.org/D24991

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-10 Thread Kuba (Brecka) Mracek via Phabricator via cfe-commits
kubabrecka added inline comments. Comment at: libcxx/include/memory:3702 +inline T +__libcpp_atomic_increment(T& t) _NOEXCEPT +{ I don't think this should be named `__libcpp_atomic_increment`, because it uses relaxed ordering and thus it's not a generic incremen

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2017-01-11 Thread Kevin Hu via Phabricator via cfe-commits
hxy9243 updated this revision to Diff 84004. hxy9243 added a comment. Minor changes on function names. Rename __libcpp_atomic_* to __libcpp_atomic_refcount_*. Repository: rL LLVM https://reviews.llvm.org/D24991 Files: libcxx/include/memory libcxx/src/memory.cpp Index: libcxx/src/memory

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-15 Thread Kevin Hu via cfe-commits
hxy9243 added a comment. Ping. @mclow.lists, @EricWF, any ideas on this patch? Thanks very much! https://reviews.llvm.org/D24991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-28 Thread Sebastian Pop via Phabricator via cfe-commits
sebpop added a comment. @mclow.lists could you please have a last look at this patch: the change is for a performance improvement (20% uplift on a proprietary benchmark), and all the issues mentioned in the review have been addressed. The existing synthetic benchmark shows an overall improvement

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-12 Thread Kevin Hu via cfe-commits
hxy9243 added a comment. Thanks for pointing out. It's true that it may cause ABI breakage. It would be nice to keep compatibility while getting the performance benefits from inlining. I've tested the patch with google-benchmark/util_smartptr_libcxx shipped with libcxx on x86_64 server, and att

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-13 Thread Sebastian Pop via cfe-commits
sebpop added a comment. In https://reviews.llvm.org/D24991#565861, @EricWF wrote: > In https://reviews.llvm.org/D24991#565715, @mclow.lists wrote: > > > How does this play with existing binaries? Applications that expect these > > functions to exist in the dylib? > > > This patch is majorly ABI

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-15 Thread Aditya Kumar via cfe-commits
hiraditya added a comment. Marshall suggests using macro as we discussed offline. For some reason the reply does not appear here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20161010/173780.html Repository: rL LLVM https://reviews.llvm.org/D24991 _

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-20 Thread Sebastian Pop via cfe-commits
sebpop added a comment. In https://reviews.llvm.org/D24991#571056, @hiraditya wrote: > Marshall suggests using macro as we discussed offline. For some reason the > reply does not appear here: > http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20161010/173780.html Ping. Repository:

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-26 Thread Sebastian Pop via cfe-commits
sebpop removed rL LLVM as the repository for this revision. sebpop updated this revision to Diff 75908. sebpop added a comment. The patch also implements the idea that Marshall proposed in: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20161010/173780.html > I have an idea; it involves

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-26 Thread Sebastian Pop via cfe-commits
sebpop marked 2 inline comments as done. sebpop added inline comments. Comment at: libcxx/include/memory:3802 +{ + return __libcpp_atomic_add(&t, 1, _AO_Relaxed); +} EricWF wrote: > Why add `increment` and `decrement` at all? Just manually inline > `__libcpp_at

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-31 Thread Kevin Hu via cfe-commits
hxy9243 accepted this revision. hxy9243 added a comment. This revision is now accepted and ready to land. Looks good to me. Notice that the performance gain can only be observed when compiled with the updated C++ header files. https://reviews.llvm.org/D24991 _

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-31 Thread Sebastian Pop via cfe-commits
sebpop added a comment. Ping: Eric, Marshall, could you please approve or comment on this patch? Thanks! https://reviews.llvm.org/D24991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-31 Thread Kuba Brecka via cfe-commits
kubabrecka added a comment. Just a question: TSan intercepts on the dylib functions, namely `__release_shared`, to track the atomic accesses. Can you make sure this doesn't break? There's a few testcases for this in compiler-rt. https://reviews.llvm.org/D24991 ___

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-02 Thread Sebastian Pop via cfe-commits
sebpop added a comment. In https://reviews.llvm.org/D24991#583877, @kubabrecka wrote: > Just a question: TSan intercepts on the dylib functions, namely > `__release_shared`, to track the atomic accesses. Can you make sure this > doesn't break? There's a few testcases for this in compiler-rt.

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-02 Thread Kuba Brecka via cfe-commits
kubabrecka added a comment. In https://reviews.llvm.org/D24991#586219, @sebpop wrote: > I just ran ninja check-all with and without this patch and there are no > regressions in compiler-rt on an x86_64-linux machine. The TSan interceptors (and testcases) are Darwin-only at this point. I'll ru

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-07 Thread Kevin Hu via cfe-commits
hxy9243 added a comment. In https://reviews.llvm.org/D24991#586248, @kubabrecka wrote: > In https://reviews.llvm.org/D24991#586219, @sebpop wrote: > > > I just ran ninja check-all with and without this patch and there are no > > regressions in compiler-rt on an x86_64-linux machine. > > > The TS

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-07 Thread Kuba Brecka via cfe-commits
kubabrecka added a comment. This passes TSan tests on Darwin. LGTM. https://reviews.llvm.org/D24991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-11-08 Thread Sebastian Pop via cfe-commits
sebpop added a comment. @mclow.lists, @EricWF, ok to commit the patch? Thanks, Sebastian https://reviews.llvm.org/D24991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-09-27 Thread Kevin Hu via cfe-commits
hxy9243 created this revision. hxy9243 added reviewers: sebpop, hiraditya, wmi. hxy9243 added a subscriber: cfe-commits. hxy9243 set the repository for this revision to rL LLVM. This patch moves some existing functions from the memory.cpp to the memory header file, so that they could be properly

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-03 Thread Kevin Hu via cfe-commits
hxy9243 updated this revision to Diff 73293. hxy9243 added a comment. Addresses comments from @halyavin, rename "atomic_support.h" to "__atomic_support" to avoid collisions with application headers. Repository: rL LLVM https://reviews.llvm.org/D24991 Files: libcxx/include/__atomic_support

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-09 Thread Marshall Clow via cfe-commits
mclow.lists added a comment. How does this play with existing binaries? Applications that expect these functions to exist in the dylib? Repository: rL LLVM https://reviews.llvm.org/D24991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-09 Thread Eric Fiselier via cfe-commits
EricWF added a comment. In https://reviews.llvm.org/D24991#565715, @mclow.lists wrote: > How does this play with existing binaries? Applications that expect these > functions to exist in the dylib? This patch is majorly ABI breaking, although we could probably find a formulation that wasn't.

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-10 Thread Sebastian Pop via cfe-commits
sebpop added a comment. In https://reviews.llvm.org/D24991#565861, @EricWF wrote: > Please provide benchmark tests which demonstrate that these benefits are > concrete and not just "potential". Moving methods out of the dylib is no > easy task so I would like hard evidence that it's worth whil

[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-10 Thread Eric Fiselier via cfe-commits
EricWF added a comment. In https://reviews.llvm.org/D24991#566140, @sebpop wrote: > In https://reviews.llvm.org/D24991#565861, @EricWF wrote: > > > Please provide benchmark tests which demonstrate that these benefits are > > concrete and not just "potential". Moving methods out of the dylib is

Re: [PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-10-13 Thread Marshall Clow via cfe-commits
On Thu, Oct 13, 2016 at 11:48 AM, Sebastian Pop wrote: > sebpop added a comment. > > In https://reviews.llvm.org/D24991#565861, @EricWF wrote: > > > In https://reviews.llvm.org/D24991#565715, @mclow.lists wrote: > > > > > How does this play with existing binaries? Applications that expect > thes

Re: [PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-09-27 Thread Andrey Khalyavin via cfe-commits
halyavin added a subscriber: halyavin. Comment at: libcxx/include/atomic_support.h:1 @@ +1,2 @@ +//===--=== +// Non-standard include files in the main include directory must start with __ to