[PATCH] D14296: [LV][LAA] Add a layer over SCEV to apply run-time checked knowledge on SCEV expressions
silviu.baranga@arm.com via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 3 10:58:54 PST 2015
sbaranga created this revision.
sbaranga added reviewers: mzolotukhin, anemet.
sbaranga added a subscriber: llvm-commits.
Herald added a subscriber: sanjoy.
This change creates a layer over ScalarEvolution for LAA and LV, and centralizes the
usage of SCEV predicates. The SCEVPredicatedLayer takes the statically deduced knowledge
by ScalarEvolution and applies the knowledge from the SCEV predicates. The end goal is
that both LAA and LV should use this interface everywhere.
This also solves a problem involving the result of SCEV expression rewritting when
the predicate changes. Suppose we have the expression (sext {a,+,b}) and two predicates
P1: {a,+,b} has nsw
P2: b = 1.
Applying P1 and then P2 gives us {a,+,1}, while applying P2 and the P1 gives us
sext({a,+,1}) (the AddRec expression was changed by P2 so P1 no longer applies).
The SCEVPredicatedLayer maintains the order of transformations by feeding back
the results of previous transformations into new transformations, and therefore
avoiding this issue.
The SCEVPredicatedLayer maintains a cache to remember the results of previous
SCEV rewritting results. This also has the benefit of reducing the overall number
of expression rewrites.
http://reviews.llvm.org/D14296
Files:
include/llvm/Analysis/LoopAccessAnalysis.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Transforms/Utils/LoopUtils.h
lib/Analysis/LoopAccessAnalysis.cpp
lib/Transforms/Utils/LoopUtils.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14296.39093.patch
Type: text/x-patch
Size: 25241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151103/271f1079/attachment.bin>
More information about the llvm-commits
mailing list