This pass converts multiple consecutive loads and stores inside a loop to memcpy operation.
For example, the stores and loads in the below code can be converted to a memcpy .
struct foo
{
int a; int b;
} f,g;
for(int i=0;i<n;i++)
{
f[i].a = g[i].a; f[i].b = g[i].b;
}
Worked in collaboration with Sebastian Pop and Aditya Kumar.
I think you can pass in an enum which has value ForMemset, ForMemsetPattern, ForMemcpy like LegalStoreKind above or just use LegalStoreKind if possible.