[PATCH] D5226: [Polly] Support memory intrinsics

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 21 07:58:06 PST 2016


jdoerfert added a comment.

In http://reviews.llvm.org/D5226#356142, @Meinersbur wrote:

> I don't see that the copied' size gets evaluated apart from checking that it's affine.
>
> Does the following work as expected?
>
>   float A[128][128], B[128];
>   for (int i = 0; i < 128; i+=1)
>     memcpy(A[i], B, 128*sizeof(float));
>


The examples contain length values already. I think they work. The evaluation can be found in MemoryAccess::buildMemIntrinsicAccessRelation.


================
Comment at: lib/Analysis/ScopInfo.cpp:306
@@ -305,1 +305,3 @@
 
+  auto *BB = getStatement()->getParent()->getRegion().getEntry();
+  auto &DL = BB->getModule()->getDataLayout();
----------------
Meinersbur wrote:
> LLVM coding style suggests to use auto only in specific cases. Eg. where the type already appears on the right side or the type is already abstracted away.
> 
> If you keep auto, the asterisk is superfluous.
> LLVM coding style suggests to use auto only in specific cases. Eg. where the type already appears on the right side or the type is already abstracted away.

Since the variable is called BB I guess the type is kinda obvious.

> If you keep auto, the asterisk is superfluous.

But it tells you that this is a pointer. We had this discussion before and while ppl started to ignore it and use plain auto I still think it is a good idea to add * and & if appropriate.


http://reviews.llvm.org/D5226





More information about the llvm-commits mailing list