Re: [PATCH] D17268: [LAA] Function 'isStridedPtr' returns additional result “Loop *Lp” via function argument and add appropriate checks out of the 'isStridedPtr'.

Roman Shirokiy via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 11:32:18 PDT 2016


roman.shirokiy updated the summary for this revision.
roman.shirokiy updated this revision to Diff 53585.
roman.shirokiy added a comment.

Ayal, Adam, thanks for the review!

Please, excuse me for messing up with the function signature, but for this time I've again considered it to be the good idea, since the restriction on loop being the innermost one seem to be redundant for "isStridedPtr".

If I understood it right, "SCEVAddRecExpr::getLoop", which is called for the SCEV of the pointer with access striding over some loop, should return this particular loop, and for the "isStridedPtr" function it is correct to compute pointer stride over this loop.

I've removed "const Loop *Lp" argument from "isStridedPtr", so the "loop-strided-over" is obtained inside the function. Now there is "ScalarEvolution::isLoopInvariant" check, where it is necessary to get stride value regarding specific (innermost) loop: stride is considered to be zero for invariant pointer access.

Updated tests, now there is one for the analysis results and one for the vectorization.

Also, change of "isStridedPtr" signature made me stumble upon http://reviews.llvm.org/rL263058. With this patch it is unnecessary to pass "Loop* L" through functions affected by http://reviews.llvm.org/rL263058, but there is also suspicious condition "isStridedPtr(PSE, LoadPtr, L) != 1 || isStridedPtr(PSE, LoadPtr, L) != 1", which looks like typo (or relying on side-effects?).

LLVM build with this patch passes LIT-testing.


http://reviews.llvm.org/D17268

Files:
  include/llvm/Analysis/LoopAccessAnalysis.h
  lib/Analysis/LoopAccessAnalysis.cpp
  lib/Transforms/Scalar/LoopLoadElimination.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Analysis/LoopAccessAnalysis/multiple-strides-rt-memory-checks.ll
  test/Transforms/LoopVectorize/multiple-strides-vectorization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17268.53585.patch
Type: text/x-patch
Size: 10528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160413/60a145e6/attachment.bin>


More information about the llvm-commits mailing list