The way to see how memcpy and alloca introduced by move is optimized

I've also been trying to tackle this from the rust codegen side, though my latest stab at it needs more work: Avoid `memcpy` in codegen for more types, notably `Vec` by scottmcm · Pull Request #112733 · rust-lang/rust · GitHub

A big problem here is provenance and undef and such, so perhaps the thing that would be most useful to rust for this is the bytes type proposal, so that we could move a String as b192, and thus allow it to be SSA register-ified, making it easier for LLVM to get rid of the allocas for small, known-size types like that.

3 Likes