Hi,
I found some cases which can be improved in LLVM optimizer:
https://godbolt.org/g/g5y9Qf
To summarize, folding memcpy calls could be interesting optimization to explore, but maybe not so trivially to implement.
Memcpy + strlen case should be easy to implement, I think I would look on it.
Thanks