halide/Halide — pull request #510 by kree-colemcalughlin (2014-10-13 20:25:04+00:00)
Title: Added a case to deinterleave that works when transposing fixed sized blo...

Added a case to deinterleave that works when transposing fixed sized blocks of data. In this case we can safely interleave if the collected stores have unit stride, and each store is simply a load with a stride equal to the vector width. Adding this case makes this optimization a little easier to trigger when doing a simple transpose.

The last test in test/correctness/interleave.cpp demonstrates this. Prior to this change trans1 would not trigger the call to interleave_vector, whereas it is probably the more likely code that people would want to write. This change essentially allows us to interleave blocks of stores of the form:
```
trans1[ramp(0, 1, 8)] = square[ramp(0, 8, 8)]
trans1[ramp(8, 1, 8)] = square[ramp(1, 8, 8)]
trans1[ramp(16, 1, 8)] = square[ramp(2, 8, 8)]
trans1[ramp(24, 1, 8)] = square[ramp(3, 8, 8)]
trans1[ramp(32, 1, 8)] = square[ramp(4, 8, 8)]
trans1[ramp(40, 1, 8)] = square[ramp(5, 8, 8)]
trans1[ramp(48, 1, 8)] = square[ramp(6, 8, 8)]
trans1[ramp(56, 1, 8)] = square[ramp(7, 8, 8)]
```
whereas before we were only interleaving:
```
trans2[ramp(0, 8, 8)] = square[ramp(0, 1, 8)]
trans2[ramp(1, 8, 8)] = square[ramp(8, 1, 8)]
trans2[ramp(2, 8, 8)] = square[ramp(16, 1, 8)]
trans2[ramp(3, 8, 8)] = square[ramp(24, 1, 8)]
trans2[ramp(4, 8, 8)] = square[ramp(32, 1, 8)]
trans2[ramp(5, 8, 8)] = square[ramp(40, 1, 8)]
trans2[ramp(6, 8, 8)] = square[ramp(48, 1, 8)]
trans2[ramp(7, 8, 8)] = square[ramp(56, 1, 8)]
```