[libcxx-commits] [libcxx] [libc++] Speed up vector<bool> copy/move-ctors [1/3] (PR #120132)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 20 09:54:22 PST 2025


philnik777 wrote:

@winner245 I disagree. This patch means more code without an obvious benefit. Since we will have the bitwise versions anyways, I don't think the points you make actually apply. Having essentially the same (or a better optimization) twice yields its own problems, since optimizations are often only applied in one case. I don't know whether that will actually be a problem, but there have been lots of places where I though there was no optimiation to gain and it turned out I was wrong.

On the reliability side, given that the two cases you mention are either something that has been addressed by the standard itself (making it a questionable decision to exploit it for any implementation) and a compilation error which no one ran into in the last decade or so (AFAICT) I doubt there is much of a real problem. I agree these are in fact bugs, I just question how wide of an impact they actually have.

(Note that I'm adding even more constant folding in #106225 to work around more constant folding problems)

https://github.com/llvm/llvm-project/pull/120132


More information about the libcxx-commits mailing list