llvm/lib/Transforms
Dorit Nuzman 3ce8b664b3 [LV] Support efficient vectorization of an induction with redundant casts
D30041 extended SCEVPredicateRewriter to improve handling of Phi nodes whose
update chain involves casts; PSCEV can now build an AddRecurrence for some
forms of such phi nodes, under the proper runtime overflow test. This means
that we can identify such phi nodes as an induction, and the loop-vectorizer
can now vectorize such inductions, however inefficiently. The vectorizer
doesn't know that it can ignore the casts, and so it vectorizes them.

This patch records the casts in the InductionDescriptor, so that they could
be marked to be ignored for cost calculation (we use VecValuesToIgnore for
that) and ignored for vectorization/widening/scalarization (i.e. treated as
TriviallyDead).

In addition to marking all these casts to be ignored, we also need to make
sure that each cast is mapped to the right vector value in the vector loop body
(be it a widened, vectorized, or scalarized induction). So whenever an
induction phi is mapped to a vector value (during vectorization/widening/
scalarization), we also map the respective cast instruction (if exists) to that
vector value. (If the phi-update sequence of an induction involves more than one
cast, then the above mapping to vector value is relevant only for the last cast
of the sequence as we allow only the "last cast" to be used outside the
induction update chain itself).

This is the last step in addressing PR30654.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 07:56:31 +00:00
..
Coroutines [coro] Make Spill a proper struct instead of deriving from pair. 2017-10-31 19:22:55 +00:00
Hello
InstCombine Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
Instrumentation Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
IPO Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
ObjCARC Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
Scalar [EarlyCSE] recognize swapped variants of abs/nabs as equivalent 2017-12-13 22:57:35 +00:00
Utils [LV] Support efficient vectorization of an induction with redundant casts 2017-12-14 07:56:31 +00:00
Vectorize [LV] Support efficient vectorization of an induction with redundant casts 2017-12-14 07:56:31 +00:00
CMakeLists.txt
LLVMBuild.txt