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 alloca
s for small, known-size types like that.