Clang emits memcpy for std::swap, which can introduce undefined behavior
1–10 of 83 posts
Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#2Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#3Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#4IIRC, there are passes that also detect memcpy-"equivalent" loops and replace them with the builtin to memcpy (mostly to get the vectorization benefit). And of course there's SimplifyLibCalls (or whatever it's named) that undoes this or any other "you called a standard library function we know how to inline in this case".
Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#5Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#6IIRC, there are passes that also detect memcpy-"equivalent" loops and replace them with the builtin to memcpy (mostly to get the vectorization benefit). And of course there's SimplifyLibCalls (or whatever it's named) that undoes this or any other "you called a standard library function we know how to inline in this case".
The second one sounds like big fun when you LD_PRELOAD a different memcpy (say, for debugging purposes) and spend hours and hours trying to figure out why it is not being called.
Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#7Aside: am i crazy for pronouncing clang see-lang in my head?
Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#8IIRC, there are passes that also detect memcpy-"equivalent" loops and replace them with the builtin to memcpy (mostly to get the vectorization benefit). And of course there's SimplifyLibCalls (or whatever it's named) that undoes this or any other "you called a standard library function we know how to inline in this case".
The second one sounds like big fun when you LD_PRELOAD a different memcpy (say, for debugging purposes) and spend hours and hours trying to figure out why it is not being called.
Re: Clang emits memcpy for std::swap, which can introduce undefined behavior
#9Aside: am i crazy for pronouncing clang see-lang in my head?