[PATCH] D19487: [LV] Reallow interleaved load groups with gaps

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 03:19:14 PDT 2016


sbaranga accepted this revision.
sbaranga added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D19487#412582, @mssimpso wrote:

> Addressed Silviu's comments.
>
> Thanks for catching the negative stride. I now check that a group is not reversed (stride is negative) before allowing it. I also added a reversed test case and check that we do not generate vector loads. For negative strides, we will need a scalar prologue iteration rather than an epilogue, but I'd rather tackle that in a follow-on patch. In the meantime, I've refactored the current patch to distinguish the epilogue and prologue cases. Thanks!


Thanks! LGTM now.

FWIW, for the reverse group we don't need a scalar prologue. It would be enough to "shift right" the interleaved access group such that we have a load at the last position in the group. I've added a comment in the test case.


================
Comment at: test/Transforms/LoopVectorize/interleaved-accesses.ll:376
@@ +375,3 @@
+;
+; void load_gap_reverse(struct pair *P1, struct pair *P2, int X) {
+;   for (int i = 1023; i >= 0; i--) {
----------------
This would work if the wide load started at &A[i].x: it would solve the OOB in the initial iteration problem and the scalar iterations at the end would solve the OOB at the final iteration of the vector loop.


http://reviews.llvm.org/D19487





More information about the llvm-commits mailing list