[PATCH] [Polly][Fix] Teach the IslExprBuilder about vector lanes

Tobias Grosser tobias at grosser.es
Fri Oct 10 08:17:49 PDT 2014


Hi Johannes,

the general idea of the patch is fine, but I feel a little uncomfortable to teach the IslExprBuilder about vectorization. Vectorization logic does not really seem related to code generating an isl expression.

Instead of checking for the VectorLoopId in the ExprBuilder and adjusting it there, would it make sense to (temporarily) update the IDToValueMap of the IslExprBuilder to contain the right value?

I did not fully think this trough in terms of code, but wanted to get the review out quick as the bug I found may save you some time. Please let me know what you think regarding the comment above.

================
Comment at: lib/CodeGen/IslExprBuilder.cpp:450
@@ +449,3 @@
+    Value *Offset = ConstantInt::get(V->getType(), VectorLane);
+    V = Builder.CreateAdd(V, Offset);
+  }
----------------
This seems incorrect in case the vector loop has a stride > 1. You would need to add Stride * VectorLane, I suppose.

http://reviews.llvm.org/D5704






More information about the llvm-commits mailing list