[PATCH] D12905: [SCEV][LV] Introduce SCEV Predicates and use them to re-implement stride versioning

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 07:53:40 PDT 2015


sbaranga created this revision.
sbaranga added reviewers: anemet, mzolotukhin.
sbaranga added subscribers: hfinkel, sanjoy, rengolin, jmolloy, llvm-commits.

SCEV Predicates represent conditions that typically cannot be derived from
static analysis, but can be used to reduce SCEV expressions to forms which are
usable for different optimizers.

ScalarEvolution now has the rewriteUsingPredicate method which can simplify a
SCEV expression using a SCEVPredicateSet. The normal workflow of a pass using
SCEVPredicates would be to hold a SCEVPredicateSet and every time assumptions
need to be made a new SCEV Predicate would be created and added to the set.
Each time after calling getSCEV, the user will call the rewriteUsingPredicate
method.

We add two types of predicates
SCEVPredicateSet - implements a set of predicates
SCEVEqualPredicate - tests for equality between two SCEV expressions

We use the SCEVEqualPredicate to re-implement stride versioning. Every time we
version a stride, we will add a SCEVEqualPredicate to the context.
Instead of adding specific stride checks, LoopVectorize now adds a more
generic SCEV check.

We only need to add support for this in the LoopVectorizer since this is the
only pass that will do stride versioning.

The only effect of this change is that now the number of versioned strides
will be limited to 16 (which is should be better than having no limit).

http://reviews.llvm.org/D12905

Files:
  include/llvm/Analysis/LoopAccessAnalysis.h
  include/llvm/Analysis/ScalarEvolution.h
  lib/Analysis/LoopAccessAnalysis.cpp
  lib/Analysis/ScalarEvolution.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12905.34892.patch
Type: text/x-patch
Size: 39417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150916/4f3b0dde/attachment.bin>


More information about the llvm-commits mailing list