[libcxx-commits] [PATCH] D63063: Bug 42208: speeding up std::merge
Eric Fiselier via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 28 14:38:57 PDT 2019
EricWF added inline comments.
================
Comment at: include/algorithm:1725
if (__n > 0)
_VSTD::memmove(__result, __first, __n * sizeof(_Up));
return __result + __n;
----------------
`__builtin_memmove` is constexpr, so I think using that is a better approach that branching on `is_constant_evaluated`.
================
Comment at: include/algorithm:4394
+ if (__comp(*__first2, *__first1)) goto __takeSecond;
+ *__result = *__first1;
+ ++__first1, (void)++__result;
----------------
Everytime I've seen a duff's device optimization, it's a win is some cases and a loss in others. That makes me skeptical that it's the libraries job to perform the loop unrolling.
Do you know why LLVM is failing to generate comparable code here?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63063/new/
https://reviews.llvm.org/D63063
More information about the libcxx-commits
mailing list