[PATCH] D26991: Hoist redundant load

2016-11-29 Thread Aditya Kumar via Phabricator via cfe-commits
hiraditya added inline comments. Comment at: libcxx/include/algorithm:1499 +// Load the first element from __first2 outside the loop because it is loop invariant +typename iterator_traits<_RandomAccessIterator1>::value_type __firstElement2 = *__first2; +

[PATCH] D26991: Hoist redundant load

2016-11-29 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists requested changes to this revision. mclow.lists added inline comments. This revision now requires changes to proceed. Comment at: libcxx/include/algorithm:1499 +// Load the first element from __first2 outside the loop because it is loop invariant +typename

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists accepted this revision. mclow.lists added a comment. This revision is now accepted and ready to land. This looks fine to me - though I wonder if the compiler can hoist `*__first2` w/o us helping it. https://reviews.llvm.org/D26991 ___

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Aditya Kumar via Phabricator via cfe-commits
hiraditya updated this revision to Diff 79463. hiraditya added a comment. Removed unused code. https://reviews.llvm.org/D26991 Files: libcxx/include/algorithm Index: libcxx/include/algorithm === --- libcxx/include/algorithm +++

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Aditya Kumar via Phabricator via cfe-commits
hiraditya added a comment. @mclow.lists I can remove this and update this patch with the load hoisted, if this is okay. https://reviews.llvm.org/D26991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. There are no uses of `_LIBCPP_UNROLL_LOOPS` in LLVM (other than the ones in ``. Googling for `_LIBCPP_UNROLL_LOOPS` on github finds the ones in libc++, and no others. I think I'll just take it out, and see what happens. https://reviews.llvm.org/D26991

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Sebastian Pop via Phabricator via cfe-commits
sebpop added a comment. In https://reviews.llvm.org/D26991#606764, @mclow.lists wrote: > /me wonders what the perf difference when `_LIBCPP_UNROLL_LOOPS` is defined > or not. > > I think this (`_LIBCPP_UNROLL_LOOPS`) falls squarely into Chandler's request > that we complain to him when the

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. __search is the only place where `_LIBCPP_UNROLL_LOOPS` is currently used. https://reviews.llvm.org/D26991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. /me wonders what the perf difference when `_LIBCPP_UNROLL_LOOPS` is defined or not. I think this (`_LIBCPP_UNROLL_LOOPS`) falls squarely into Chandler's request that we complain to him when the compiler generates sub-optimal code, instead of doing things like

[PATCH] D26991: Hoist redundant load

2016-11-28 Thread Sebastian Pop via Phabricator via cfe-commits
sebpop added a comment. Let's also add a testcase and show the performance improvement. https://reviews.llvm.org/D26991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26991: Hoist redundant load

2016-11-22 Thread Aditya Kumar via cfe-commits
hiraditya created this revision. hiraditya added reviewers: EricWF, mclow.lists. hiraditya added a subscriber: cfe-commits. Worked with Sebastian Pop https://reviews.llvm.org/D26991 Files: libcxx/include/algorithm Index: libcxx/include/algorithm