[libcxx-commits] [PATCH] D128146: [libc++] Use uninitialized algorithms for vector

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 5 13:58:18 PDT 2022


var-const added a comment.

In D128146#3703008 <https://reviews.llvm.org/D128146#3703008>, @ldionne wrote:

> In D128146#3699909 <https://reviews.llvm.org/D128146#3699909>, @vitalybuka wrote:
>
>>> @vitalybuka This isn't unexpected. `-fno-inline` disables inlining, which is essential for a lot of other optimizations. Using `-fno-inline` pretty much defeats the optimizer: https://godbolt.org/z/zrE5o1WK1.
>>
>> I am more concerned about sanitizers
>>
>> https://godbolt.org/z/1x9qjGG19 Near LBB11_5 we have now __asan_memcpy per every "P", before it was for entire vector.
>> I assume some additional improvement in instrumentation are possible, maybe replacing fixed short asan_memcpy with check/load/store. Or even optimizing asan_memcpy itself.
>>
>> But still maybe some ideas if it's solvable on libc++ level so we rely less on optimizations?
>
> I suspect this might go away if we manually lowered `std::uninitialized_foo` to `memcpy` like we do for `std::copy` and `std::move`.

(Just in case, I had a patch to do that a while ago: https://reviews.llvm.org/D118329)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128146/new/

https://reviews.llvm.org/D128146



More information about the libcxx-commits mailing list