We've got a loop idiom recognizer that can spot a memcpy, but as far as I can tell nothing for the case where the user has "helpfully" unrolled their loops for us, leaving a linear load/store sequence.
This pass seemed to have most of the machinery in place already to form memsets, so I adapted it to also create memcpy calls when it could. I've run the test-suite with no issues, but I'm still not really in familiar code so I'd appreciate someone else looking over the code.
Cheers.
Tim.
comment should be updated.