This change adds support for transforming loops such as
void test (unsigned *f) {
for (int i = 65536; i >= 0; i--) { f[i] = 0; }
}
into memsets. Previously, we were unable to transform loops with negative strides.
Passes all correctness for Spec2000, Spec2006, and LNT. Transforms a number of benchmarks in Spec2000 and Spec2006.
Please take a look.
Chad
You can update this comment to reflect that we can handle negative strides with this patch. Loop reversal is a separate optimization, so I think it makes sense to catch the simple case here, especially since the implementation is minimal. The follow-on patch would be to handle the negative stride in processLoopMemSet.