[PATCH] D24189: [LAA] Extend isConsecutiveAccess to determine if two accesses are consecutive, reverse consecutive, or non-consecutive.

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 06:53:58 PDT 2016


mcrosier created this revision.
mcrosier added reviewers: mkuper, mssimpso.
mcrosier added a subscriber: llvm-commits.
Herald added subscribers: mzolotukhin, sanjoy.

The current implementation of isConsecutiveAccess(A,B) checks to see if access A is followed by access B.  With little additional work we can determine if B is followed by A (i.e., reverse consecutive) or if A and B are not known to be consecutive.

This patch modifies isConsecutiveAccess to:
  - List Item return 1 if A and B are consecutive and B follows A,
  - List Item return -1 if A and B are consecutive and A follows B (i.e., reverse consecutive) or,
  - List Item return 0 if we can't prove and A and B to be consecutive.

This is very similar to the behavior of the isConsecutivePtr function in the loop vectorizer and IMO having isConsecutiveAccess follow suit makes sense.

This patch also uses this new functionality to reduce the number of calls to isConsecutiveAccesses in the SLP vectorizer.

Across SPEC2000 and SPEC2006 the total number of calls to isConsecutiveAccess is reduced by 4.31% or 18875 calls.  There should be no functional change other then the reduction is calls.

All of the SPEC200X and llvm test-suite tests passed correctness tests and show no codegen changes as expected.  I plan on kicking off the compile-time regression tests over the weekend.

 Chad

https://reviews.llvm.org/D24189

Files:
  include/llvm/Analysis/LoopAccessAnalysis.h
  lib/Analysis/LoopAccessAnalysis.cpp
  lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  lib/Transforms/Vectorize/SLPVectorizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24189.70153.patch
Type: text/x-patch
Size: 9312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160902/7cede2d5/attachment.bin>


More information about the llvm-commits mailing list