[libcxx-commits] [PATCH] D118329: [libc++] Optimize algorithms on uninitialized memory for trivial types.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 27 13:59:17 PST 2022


ldionne added a comment.

In D118329#3277050 <https://reviews.llvm.org/D118329#3277050>, @Quuxplusone wrote:

> FWIW, libc++'s historical position on this kind of optimization (which I associate particularly with Marshall's tenure) is "libc++ should do the simple thing; file a codegen bug against //Clang// if it's failing to optimize our simple template code for some trivial type."  TBF, I have not looked closely at this PR to know whether that attitude would be unfair here for some reason.
> Do you have a Godbolt of the codegen before and after? (You should.)

FWIW, I "sponsored" this patch in that I believe I was the one to request that we do it (or if not, then I immediately thought it was a good idea). I've also gone through several review iterations on it with Costa before it got published, so this is not far from a LGTM from my side.

However, I do agree it should be backed by at least some proof that it improves codegen. If Clang always ends up doing the right thing without us having to lift a finger, then this complexity is not actually worth it since the naive code "just works". I'd be surprised if Clang was clever enough to perform these optimizations in all cases, but I could be surprised.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118329



More information about the libcxx-commits mailing list